Upvote 1

How do I control the style of an input depending on the focus?

In Progress Judit Casacuberta 2 years ago

I want to change the border of an input depending on the focus, I want the input border to change when the focus isn't on the input. How can I do that?

Use Example:

"Mouse enter" the border becomes visible, if you click on the input the border keeps visible, if you leave the input with the focus still on (your are typing) I want the border to still be visible, but if I click somewhere else (so the focus is not on the input anymore) I want the border to became hidden.


Replies (1)

It sounds like the "On Focus Out" trigger is what you're looking for. With events using that trigger, when you focus out (click out of) an Input, you'll see the action you defined occur (like changing the border).

Leave a Comment
Attach a file