Uploaded image for project: 'ListenBrainz'
  1. ListenBrainz
  2. LB-942

Disable listen page navigation when textarea is focused

XMLWordPrintable

      Currently, we bind right/left arrow keyboard keys to navigate to the next/previous page of listens.
      When the user is writing text in an input (for example in the "pin recording" and "CritiqueBrainz review" modals where there is a large text input) and uses keyboard arrows to step through the text they are writing, navigation of listens pages occurs in the background.

      The existing code has support for ignoring navigation keys if an input is currently in focus:
      https://github.com/metabrainz/listenbrainz-server/blob/master/listenbrainz/webserver/static/js/src/RecentListens.tsx#L361-L363

      However, `document.activeElement?.localName === "input"` does not take into account textarea elements (inputs != textarea).
      The code should be amended to also support textareas and any other user input elements

            mr_monkey Monkey
            mr_monkey Monkey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package