autocomplete icon indicating copy to clipboard operation
autocomplete copied to clipboard

Focus not trapped in detached mode

Open stefanprobst opened this issue 4 years ago • 2 comments

Description

when in detached mode (fullscreen or modal), focus should be trapped.

Reproduction

Steps

  1. Go to https://www.algolia.com/doc/ui-libraries/autocomplete/introduction/what-is-autocomplete/
  2. Reduce viewport width to 500px to switch to detached mode.
  3. Click on the first autocomplete.
  4. Press Tab a couple of times (or Shift+Tab)
  5. Some hidden element is focused, and modal can't be closed with Esc anymore

Expected behavior

focus should be trapped.

Environment

  • OS: [e.g. Windows / Linux / macOS / iOS / Android]
  • Browser: [e.g. Chrome, Safari] Firefox 88
  • Autocomplete version: [e.g. 1.0.0] 1.0.1

stefanprobst avatar May 19 '21 13:05 stefanprobst

Thanks for the report—focus trap is on our list!

We plan to implement it in a similar way as in DocSearch.

francoischalifour avatar May 19 '21 14:05 francoischalifour

Is this the same reason why my keydown/keyup events don't trigger a scroll on the list in detached mode?

https://deploy-preview-15--redpanda-antora-site.netlify.app/current/home/

JakeSCahill avatar Aug 21 '23 12:08 JakeSCahill