Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: keyboard caching does not differentiate between desktop and mobile #126

Open
sentry-io bot opened this issue Jan 28, 2025 · 3 comments
Open

bug: keyboard caching does not differentiate between desktop and mobile #126

sentry-io bot opened this issue Jan 28, 2025 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@sentry-io
Copy link

sentry-io bot commented Jan 28, 2025

Sentry Issue: KEYMANWEB-COM-1VT

TypeError: null is not an object (evaluating 'this.getElem().parentNode')
  at None (/keyboard/japanese/1.0.1/japanese-1.0.1.js:192:21)
  at None (/keyboard/japanese/1.0.1/japanese-1.0.1.js:104:27)
  at _KeyboardInterface.process (https://s.keyman.com/kmw/engine/17.0.334/src/common/web/keyboard-processor/src/text/kbdInterface.ts:1078:19)
  at _KeyboardProcessor.processKeystroke (https://s.keyman.com/kmw/engine/17.0.334/src/common/web/keyboard-processor/src/text/keyboardProcessor.ts:225:46)
  at _InputProcessor._processKeyEvent (https://s.keyman.com/kmw/engine/17.0.334/src/common/web/input-processor/src/text/inputProcessor.ts:194:47)
...
(11 additional frame(s) were not displayed)
@sentry-io sentry-io bot added the bug Something isn't working label Jan 28, 2025
Copy link
Author

sentry-io bot commented Jan 28, 2025

Sentry Issue: KEYMANWEB-COM-1VV

@jahorton
Copy link
Contributor

For both these Sentry events, the underlying cause is that keyboards not targeting mobile-web, such as the CJK keyboards (and japanese in particular), will be made available on mobile-web due to the current caching scheme. This should not be the case for such keyboards due to lack of support.

These errors are related and surface because the japanese keyboard assumes that it will have successfully inserted its picker elements into the page's hierarchy and be able to look them up later by ID. The picker insertion only occurs in the Web engine's "desktop" mode - and not on touch devices. Since the picker elements never get inserted when in "mobile" mode, any search for the element returns a null.

@jahorton
Copy link
Contributor

One approach would be to detect which form-factor a user is utilizing and target keyboards supporting that. Granted, this is likely available only client side, so we may need to link in both versions of the cache, only calling the "correct" method once the Web engine's device-detection processes have completed determining the user's form-factor. (This could be done by await keyman.init or similar mechanism.

@mcdurdin mcdurdin added this to the B18S1 milestone Jan 30, 2025
@mcdurdin mcdurdin self-assigned this Feb 2, 2025
@mcdurdin mcdurdin moved this to Todo in Keyman Feb 3, 2025
@darcywong00 darcywong00 modified the milestones: B18S1, B18S2 Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

3 participants