question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTML attributes with capital letters are not converted

See original GitHub issue

Describe 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:

  1. Create a HTML table
  2. Specify tabulator-headerSort on a column
  3. Initialize Tabulator on it
  4. 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:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
olifolkerdcommented, Jan 21, 2019

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 😃

0reactions
olifolkerdcommented, Feb 9, 2019

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 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

are html5 data attributes case insensitive? - Stack Overflow
Attribute names for HTML elements may be written with any mix of lowercase and uppercase letters that are a case-insensitive match for the...
Read more >
Camel Case HTML attributes are rewritten to lowercase by AEM
Whenever a component in AEM outputs an HTML tag with an attribute that has capital letters, it is converted to lowercase.
Read more >
Forcing INPUT text to uppercase < HTML - The Art of Web
Try entering 'AAA' in the input box above, select the middle 'A' and try changing it to 'ABBA'. What you end up with...
Read more >
text-transform - CSS: Cascading Style Sheets - MDN Web Docs
The text-transform CSS property specifies how to capitalize an element's text. It can be used to make text appear in all-uppercase or ...
Read more >
HTML 5 - W3C
In the HTML syntax, attribute names may be written with any mix of lower- and uppercase letters that, when converted to all-lowercase, matches...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found