Checkbox set focus programatically?
labs20 last edited by labs20
How do you set focus on checkbox programatically?
It does not publish the deafult focus() function.
labs20 last edited by
Obs: I know that I can put it inside a field and call field.focus(), but I do not want to encapsulate it.
metalsadman last edited by
@labs20 use a ref on your checkbox maybe, and call focus on mounted with a nextTick or something like that.
dobbel last edited by dobbel
Here’s an attempt. No perfect code: focus method not found so I used a private focus method , could be improved @metalsadman? :
metalsadman last edited by metalsadman
@dobbel try refs.qchkboxref.$el.focus() or log it check on the children, and call focus on that one. Can’t post an example atm in mobile.
dobbel last edited by
Yes that worked , I updated the codepen. thanks