or
Let's use the example bellow
if you are already focused typing and just want to check what did you type to keed typing, your keyboard is going to close
You need to notice it closed, and decide to touch the input to focus and get back to typing, it affects both desktop and mobile applications on the web
See it in practice in a real life example and just image how frustrating it can be:
When the user interact with the show/hide button we can directly call the focus method on the input element
Now on the next example, when you show/hide the input password the focus is preserved, which also keep keyboards open on iOS and Android devices
Try it yourself, it is quite pleasant
If the input is not focused already, and someone interact with the show/hide button it must not focus the input
If you see problems regardless accessibility, please let me know by emailing me at [email protected] and I'll update this page accordingly