Installation

  • git clone <repository-url> this repository
  • cd power-select-in-modal-focus-bug
  • yarn install

Running / Development

Bug description

What are possible reasons that an input-field doesn't get the focus via .focus()? Having this problem right now with a power-select which is placed in a modal (both wormholed) where the search-input doesn't get focused when you open the select-options. Already tried to add a delay with later(), tried to unfocus the previous focused element first with document.activeElement.blur() - but the focus stays on the power-select-trigger... The strange thing is that if you click on the search-input once, the focus works (also if you close the power-select + reopen it)

How to reproduce

  1. open power-select
  2. -> no focus on search-input
  3. click on search-input
  4. -> focus on search-input
  5. close power-select
  6. open power-select
  7. -> focus still works
  8. close power-select + modal
  9. open modal + power-select
  10. -> no focus on search-input