Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x-ref won't focus an input #317

Closed
flick36 opened this issue Mar 30, 2020 · 4 comments
Closed

x-ref won't focus an input #317

flick36 opened this issue Mar 30, 2020 · 4 comments

Comments

@flick36
Copy link

flick36 commented Mar 30, 2020

Hi so, I've a modal wich i open abusing the dispatch events (so i can open from outide the component), and i want to focus an input so I've tried using x-ref on the input and then applied focus via $nextTick but it won't focus the input, contrary to when i do $el.focus() it'll focus the modal correctly. I've setup an JSBIN here: https://jsbin.com/wigupiloxa/edit?html,output. Any idea what can i do to focus the input?

@flick36 flick36 changed the title x-fer won't focu an input x-fer won't focus an input Mar 30, 2020
@flick36 flick36 changed the title x-fer won't focus an input x-ref won't focus an input Mar 30, 2020
@HugoDF
Copy link
Contributor

HugoDF commented Mar 30, 2020

Does using setTimeout instead of $nextTick work?

I do believe there's an issue where $nextTick is run at the wrong time during updates

@flick36
Copy link
Author

flick36 commented Mar 30, 2020

Yes, setTimeout works :o

@HugoDF
Copy link
Contributor

HugoDF commented Mar 30, 2020

Cool, there's probably a $nextTick issue then

@ryangjchandler
Copy link
Contributor

I'm going to close this issue and ask for any further discussion to be moved to the issue and PR mentioned above. Thanks guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants