HTML attributes with capital letters are not converted
See original GitHub issueDescribe the bug
Specifying column configuration via HTML th
elements doesn’t seem to work for attributes that contain capitalized characters.
An example of this is the headerSort
attribute; it seems impossible to set tabulator-headerSort="false"
via HTML.
The reason seems to be that, even though the attribute is correctly taken from the HTML and inserted into the column definition via _extractHeaders
, the attribute is - perhaps automatically by the browser, as I don’t see any actual conversion happening - converted to lower-case when that happens.
Later on, in the implementation, a check then happens on column.definition.headerSort !== false
, which then always returns true because the value is undefined
, whilst the actual value can be found in column.definition.headersort
due to the casing conversion.
Tabulator Info
- Which version of Tabulator are you using? 4.1.5
- Post a copy of your construct object if possible so we can see how your table is setup
(Roughly reconstructed from an extraction of a much larger example:)
<table>
<thead>
<tr>
<th
tabulator-field="field"
tabulator-headerSort="false"
tabulator-header-sort="false"
>
Testcolumn
</th>
</tr>
</thead>
<tbody>
<tr>
<td>Test</td>
</tr>
</tbody>
</table>
To Reproduce Steps to reproduce the behavior:
- Create a HTML table
- Specify
tabulator-headerSort
on a column - Initialize Tabulator on it
- The column will still be sortable
Expected behavior The column is not sortable.
Desktop (please complete the following information):
- OS: Linux
- Browser: Firefox and WebKit(GTK)
- Version Firefox 64 and WebKitGTK 2.22.5
Additional context This functionality works fine when using it from the JavaScript context.
It is mentioned somewhere that there are limitations to the HTML import, is this perhaps one of them? If so, it may be interesting to explicitly mention this somewhere.
I had trouble earlier where Tabulator was ignoring my minWidth
, but now I understand that this may be the same issue as that also happens to be a property with capitalization in it, but if this turns out to be another problem, I’ll be sure to let you know.
May be related to #1740.
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Hey @tominventisbe
That is definitely a bug, i will look into getting that fixed on the 4.2 release at the end of the month.
Thanks for letting me know.
Cheers
Oli 😃
I have pushed a fix for this to the 4.2 branch and will include it in modays release.
Thanks for the headsup
Cheers
Oli 😃