vue-final / vue-final-modal

🍕Vue Final Modal is a tiny, renderless, mobile-friendly, feature-rich modal component for Vue.js.
https://vue-final-modal.org
MIT License
864 stars 95 forks source link

Cannot focus nested input #369

Closed AmitJoki closed 1 year ago

AmitJoki commented 1 year ago

Version

vue-final-modal: 4.0.11 vue: 3

OS

Mac

Reproduction Link

https://codesandbox.io/s/happy-tdd-tluovu?file=/src/ModalConfirm.vue

Steps to reproduce

  1. There's Click me button in the page -> Click it and click on input -> Works correctly. This is normal and expected.
  2. Then there's a Open modal button which opens a Vue Final Modal which contains the same dropdown. Click on Open modal and repeat step 1, it does not work anymore. The input does not get focus.

What is Expected?

Input should be focused.

What is actually happening?

Input is not focused.

Additional Info

Maybe related to: #332 ?

I have also disabled focusTrap by setting :focusTrap="false" but that does not make any difference.

AmitJoki commented 1 year ago

Seems like a case of HMR not working. It worked after a couple of refreshes with :focusTrap="false"

hgiesel commented 1 year ago

Anybody discovering this afterwards: Focus the input in the opened event.