InputText focus

UI Components for Vue
Post Reply
jcrisantog
Posts: 1
Joined: 25 Jun 2020, 23:06

25 Jun 2020, 23:10

Hi.

How can I focus on an InputText after executing a method ... try the instruction below but it doesn't work

this. $ refs.email.focus ();

Thank you.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

04 Jul 2020, 10:25

Please try;

Code: Select all

this.$refs.email.$el.focus();

colinbes
Posts: 17
Joined: 26 May 2021, 23:50

02 Jan 2022, 20:45

Did you come right with this?

Looks to me that one has to access first child element after <span> wrapper that InputText uses.

i.e.,

Code: Select all

  const p1 = pin_1.value.$el.children[0]
  p1.focus()
which feels rather messy

Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests