Input focus works unreliably? #17387
Unanswered
ivanjaros
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
-
I have a component that has q-input. This q-input has reference defined. From parent, I invoke a custom method in this component which changes internal data field for this q-input. Optionally, I focus on this q-input. The problem is that the first call to
this.$refs.myinput.focus()
is working, but subsequent calls seem to work randomly and unreliably. If on the other hand I callthis.$refs.myinput.$el.focus()
, it works 100% of the time. Seems to me like the q-input has an internal state which is not properly detecting blur? Is this a bug?Another thing might be that the parent has a button that when clicked, this method of mine is invoked. So I can imagine that when i focus this inner q-input, then in parent click on a button, which blurs this inner q-input, but that button calls the aforementioned method which invokes focus, that maybe there is some mixing of even orders or delays or maybe vue event loop not being fast...
PS: to illustrate the structure:
PARENT
---BUTTON <- triggers method on FOO_COMPONENT
---FOO_COMPONENT <- method changes state for qinput vmodel and calls focus on it via reference
------Q-INPUT
Beta Was this translation helpful? Give feedback.
All reactions