- Issue created by @narendraR
- Issue was unassigned.
- 🇮🇳India narendraR Jaipur, India
Same issue exists on module uninstall page also. May be we want to hide this cross icon altogether through css. Will work on the issue once the path is decided.
- 🇩🇪Germany marcoliver Neuss, NRW, Germany
Since the X is a canonical feature of the search input, I'd suggest not hiding it, but fixing the filter behavior in Drupal.
I have attached a patch that runs the filter on the modules list not only on keyup but also on click. I've chosen this approach since there seems to be no widely supported way of detecting just the field being cleared.
- Status changed to Needs review
over 1 year ago 8:07am 10 August 2023 - last update
over 1 year ago 29,958 pass - Status changed to RTBC
over 1 year ago 9:48am 10 August 2023 - 🇮🇳India narendraR Jaipur, India
Tested manually on both Module Install and Uninstall page and now this is working as expected. Marking as RTBC.
- Status changed to Needs work
over 1 year ago 1:03pm 10 August 2023 - 🇺🇸United States bnjmnm Ann Arbor, MI
+++ forkDstPrefix/core/modules/system/js/system.modules.js @@ -104,6 +104,7 @@ keydown: preventEnterKey,
I believe this might be better addressed by changing the keyup event to an input event, as opposed to adding a click listener. While this isn't a particularly expensive operation, a click listener will unnecessarily invoke the callback if the cursor is moved via pointer. Changing to an input event is actually more aligned with the goals of this feature as it only fires when the string changes or is cleared. Keyup on the other hand listens to any keypress - even those not altering the input value.
My hunch is keyup was used instead of input in #1848064: Allow to filter modules by arbitrary search strings on the Modules page → because at the time of its addition the input even was not fully supported by all Drupal-supported browsers.
Setting back to NW and requesting one of the following
- Switch to an input event instead of adding a click listener
- Confirm why keyup should be kept (either due to it being a better choice or backwards-compatibility concerns)
If the above doesn't happen within a few weeks I think it's reasonable to file a followup issue to investigate the above and just let this in so finding the ideal fix doesn't obstruct an acceptable fix. It's far preferable to address within this issue's scope, but I don't want it dying on the vine either.
- 🇩🇪Germany marcoliver Neuss, NRW, Germany
Good point, bnjmnm! But I think we may have an issue with Opera mini. It's listed as a supported browser, but according to caniuse does not support the input event, so I suppose the input event is not a viable option in this use case and we'll have to work around it.
- Status changed to Closed: duplicate
over 1 year ago 5:19am 14 August 2023