1

I am developing an on-screen keyboard. I want to disable keyboards of mobile devices while the osk is open. One way is to make input read-only, so that focusing on it not opening the keyboard. But using that solution, the user can't change cursor pointer (and also does not see any cursor while writing with osk) and can't select one part of text to delete.

Is there any other solution to stop mobile device keyboard from openning while focusing on input? Something like a specific attribute or styling value or etc.

Thnaks in advance. TG.

// UPDATE

one solution with readonly

ConductedClever
  • 4,175
  • 2
  • 35
  • 69
  • Possible duplicate of https://stackoverflow.com/questions/10940287/html-mobile-forcing-the-soft-keyboard-to-hide – Narendra Dec 19 '18 at 01:57

1 Answers1

0

EDIT:

Okay, to hide the keyboard for mobile users is not something you can prevent directly, but there is an alternative.

The "OnFocus" Event activates when a specific elements gets focused. this way you can add a bit of code to prevent a mobile keyboard from popping up.

this way we can add the "Blur()" method to it.

so it would look something like this:

<input type="text" name="noKeyboardForMobile" onfocus="blur();" />
  • You have answer reverse way. I want pointer events but not mobile keyboard popup on focus. The problem is making field readonly stops mobile from opening soft keyboard up but also removes pointer-events! – ConductedClever Dec 18 '18 at 11:12
  • Thanks for your answer. But I want it to stay focused, so that the user see the cursor and can delete some part of it. – ConductedClever Dec 19 '18 at 05:21