keyman icon indicating copy to clipboard operation
keyman copied to clipboard

fix(web): better element inputmode management 📴

Open jahorton opened this issue 3 years ago • 3 comments

Refer to https://github.com/keymanapp/keyman/pull/7343#discussion_r985318712.

If a website designer would normally be specifying input mode for elements that KMW will be managing, we should put forth a good-faith effort to remember what the page's original settings were. At some point, we might even go so far as to support 'intent' behavior in KMW... but not this release cycle.

  • In this regard, refer to #1221. It's the main example of a pre-existing feature request I've found in-repo.

jahorton avatar Oct 04 '22 05:10 jahorton

I appreciate this design. You are trying to prevent inputMode from being overwritten by other Javascript code, which would stop Keyman from working.

Not just that - long-term perspective, it'll store updates to the field's intended inputmode. Should we ever support any form of "intents" within KeymanWeb, we could also use that stored value to drive intent-based behaviors. The funky caveat is that we'd need a way to let page devs retrieve their prescribed inputmode.

I wonder if setting inputmode = none only on element focus & removing it on element blur would still hide a device's native OSK while allowing the property to be available most of the time to page devs. But that could get complex and/or brittle. Probably better to just provide a get/set keymanInputMode or something if and when the time comes.

jahorton avatar Oct 05 '22 08:10 jahorton

Probably better to just provide a get/set keymanInputMode or something if and when the time comes.

Yes. We can't develop in a vacuum. Better to give site developers the tools to connect the dots between their frameworks and Keyman input method than to try and 'magically' make it work ... magic will only get us so far, and then it breaks badly!

mcdurdin avatar Oct 06 '22 07:10 mcdurdin

Changes in this pull request will be available for download in Keyman version 16.0.82-alpha

keyman-server avatar Oct 17 '22 18:10 keyman-server