3 ms·
use @media to do what in this case? to not display the virtual keyboard on input.onfocus?
by al_be_back 3y ago
use @media to do what in this case? to not display the virtual keyboard on input.onfocus?
- mhb 3y agoDisable autofocus when using a device (mobile?) on which it is problematic? I'm no expert though. Maybe that isn't possible or is more undesirable for some other reason.
- al_be_back 3y agoYes [however] you could using props like <input inputmode='none'> or <input readonly='readonly'> and that prevents the device's virtual keyboard from opening 'onfocus'. however, that's not practical, if you want to type/enter data into it during that session.
- mhb 3y agoMaybe I'm not understanding the objective or the constraints. I thought the goal is to disable autofocus on mobile devices in order to prevent the appearance of the virtual keyboard from unexpectedly disturbing the layout. In order to achieve this why not use @media to identify a device which uses touch input (I'm sure there are some edge cases, but this seems like a good proxy for a mobile device) and javascript or jquery to disable autofocus?