Clicking X in input type search on module page on chrome does nothing

Created on 10 August 2023, 11 months ago
Updated 14 August 2023, 11 months ago

Problem/Motivation

When something is searched in module filter text-box, a X icon (Cross icon) appears on the right side of the search field. Clicking on this cross icon does not reset the list.

Steps to reproduce

Proposed resolution

Clicking on cross should reset the list.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Closed: duplicate

Version

11.0 🔥

Component
Base 

Last updated 1 minute ago

Created by

🇮🇳India narendraR Jaipur, India

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • 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 11 months ago
  • last update 11 months ago
    29,958 pass
  • 🇩🇪Germany marcoliver Neuss, NRW, Germany
  • Status changed to RTBC 11 months ago
  • 🇮🇳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 11 months ago
  • 🇺🇸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

    1. Switch to an input event instead of adding a click listener
    2. 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 11 months ago
  • 🇷🇺Russia kostyashupenko Omsk

    Closed since duplicate

Production build 0.69.0 2024