Bug 37190 - form-submit.js data- attributes should use lowercase attribute names
Summary: form-submit.js data- attributes should use lowercase attribute names
Status: RESOLVED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 36246
Blocks:
  Show dependency treegraph
 
Reported: 2024-06-25 21:31 UTC by Lucas Gass (lukeg)
Modified: 2024-07-08 16:49 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 37190: HTML data attributes are always lowercase (1.22 KB, patch)
2024-06-25 21:38 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 2024-06-25 21:31:02 UTC
If I try to add a link as a form ( see Bug 36246 ) I cannot pass the data-confirmationMsg attribute with $('.submit-form-link').data();

This is because data attribute names always get read in lowercase.
Comment 1 Lucas Gass (lukeg) 2024-06-25 21:38:02 UTC
Created attachment 168102 [details] [review]
Bug 37190: HTML data attributes are always lowercase

Test plan:
1. I don't really know how to write a good test plan for this one.
2. Review the changes, see if you agree.
Comment 2 Phil Ringnalda 2024-06-26 19:40:47 UTC
Test plan:
1. Read https://html.spec.whatwg.org/multipage/dom.html#attr-data-*
2. Verify that M is an ASCII upper alpha :)
Comment 3 Phil Ringnalda 2024-06-26 20:36:52 UTC
But... not sure why it works, but the example which landed with bug 36246 puts the message in the attribute data-confirmation-msg and that does work.
Comment 4 Phil Ringnalda 2024-06-26 20:44:15 UTC
Oh, it works because of https://html.spec.whatwg.org/multipage/dom.html#dom-dataset - jQuery 3+, data-foo-bar is then accessible as fooBar, not the least little bit confusing.