iOS set focus on input

I’ve just come to a situation where I need this, not because of iOS, but because my custom HTML to keep a groupfocus element always open causes issues with set focus on input…the easiest solution I found was from this post

const input = document.getElementById('YOUR_INPUT_ID_GOES_HERE'); input.select();

Screen Shot 2024-08-16 at 2.53.32 PM

This is is all you need so that any element you want to click or conditional trigger will cause the input to be focused.

I’m not 100% sure this works for iOS or not

1 Like