q-select : showPopup() closes the popup if already open — how to open on focus without click? #18266
Unanswered
StanislasJEANGEY
asked this question in
General - Components / Directives / etc
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to automatically open the
q-selectpopup when the field receives focus via keyboard (Tab), without affecting the behavior when the user clicks on it.My approach is to call
showPopup()in the@focushandler. The problem is thatshowPopup()toggles the popup — if it's already open, it closes it.This causes an issue when the user clicks the field: the click opens the popup natively, then
@focusfires andshowPopup()immediately closes it.I tried guarding with
@popup-show/@popup-hideto know whether the popup is already open before callingshowPopup(), but these events fire after@focus, even withnextTick(), so the state is never up to date in time.EDIT : It seems that it isn't showPopup() that closes the popup, but rather that it closes via the click event after being opened by showPopup()
Is there a way to:
showPopup()only when the popup is not already open?showPopup()?Any built-in prop or API on
q-selectthat handles this use case?Beta Was this translation helpful? Give feedback.
All reactions