Closed KasparRosin closed 1 year ago
Screencast from 03.04.2023 13:41:55.webm
Here is also an video of the issue. Let me know, if I can post any other information.
When a dialog (or menu) is closed the element that had focus when it was opened is focused If the close is performed exactly when pressing enter the key will also be received by the newly focused element Close the dialog with a timeout
@pdanpdan Thanks for the quick response! The timeout helps prevent it, but it still happens. Tested with 100ms timeout, ~3/10 times the state changed.
Seems that 150ms is the ideal timeout, 0/10 times the state changed. Would love an better solution, but this will work for now.
Sorry, it's hard to get a solution that works in every situation If we delay the refocusing we generate other problems when you want to change focus :(
What happened?
The layout is the following: QExpansionItem has an QButton which opens a QForm inside a QDialog.
When submitting the form by pressing "Enter" key, Quasar will also trigger onClick inside QExpansionItem, which causes the QExpansionItem to either Open/Close depending on the previous state.
What did you expect to happen?
QExpansionItem state should not change and it's internal onClick should not be called when pressing Enter inside a QDialog.
Reproduction URL
https://codepen.io/kasparrosin/pen/NWLQbaq
How to reproduce?
Flavour
Vue CLI Plugin (vue-cli-plugin-quasar)
Areas
Components (quasar), Accessibility [a11y] (quasar)