I want to fire an interaction when a form field is selected. Using a ‘Click’ trigger works fine when users select the field with their mouse, but it does not work when the user tabs through the form with their keyboard.
When the ‘Business Phone’ field is selected, I want to show a div with text.
(In the link above, clicking the field triggers the demo. Ideally, I would like to change that click interaction into an interaction triggered by selecting the field)
Cool! You actual don’t need any interactions to do this.
You can write some CSS and put it into the head tag for that page. Since a click and and using a tab both cause the input to be focused we can use the focus state and a sibling selector to alter the div.
Make sure to remove the the interaction and set the div height to zero. You won’t be able to see it work until it’s published.