Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
A polyfill for CustomEvent is needed for Internet Explorer 11.
This is one of the three polyfills from #3076171: Provide a new library to replace jQuery UI autocomplete and we are now addressing each in their own issue.
Note: White it is currently a nice-to-have, the CustomEvent polyfill will be necessary in order for the new Autocomplete issue #3076171: Provide a new library to replace jQuery UI autocomplete to land.
Comment | File | Size | Author |
---|---|---|---|
#3 | customevent_polyfill.mp4 | 1.46 MB | hooroomoo |
Issue fork drupal-3239507
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
hooroomooSpoke with user @bnjmnm and was informed despite there being no existing use to change, this polyfill is useful in reducing the scope of the Autocomplete issue.
To provide evidence the polyfill works, I temporarily added the polyfill to the messages library used by the Olivero theme. I pasted this code snippet into the JS console in IE11.
As the video shows, I received the expected console output of "event fired, cat name is Buddy"
Comment #4
hooroomooComment #5
bnjmnmIt looks like the test runner stops at spellcheck
Here's information on working with the spellchecker https://www.drupal.org/node/3122084
This can be addressed by either adding
customevent
to the skipped words dictionary or adding comments to ignore the usages in the file they appear. I recommend the first option as other libraries may wind up depending ondrupal.customevent
, and this ensures the spellchecker won't object every time a new library adds this as a dependency.Comment #6
hooroomooComment #7
bnjmnmThe MR and change record look good, and the video in #3 confirms it works as expected.
While it's true there is no current use of CustomEvent in core (other than libraries that already have this polyfilled), adding this here is helpful to reduce the overall size of #3076171: Provide a new library to replace jQuery UI autocomplete, an issue that must land for Drupal 10, and one that is unlikely to change in a manner that makes the CustomEvent polyfill unnecessary. Even if the unlikely occurs and the Autocomplete issue no longer uses CustomEvent, the presence of this polyfill is not a major burden on core as it's small, demonstrated to work, and is only loaded if explicitly added as a dependency to another library.
Comment #9
catchMakes sense to get this in separate to the autocomplete issue.
Committed b986c49 and pushed to 9.3.x. Thanks!