Closed jahorton closed 4 months ago
I wonder if recent work from #10662 might be useful here; when the iOS context-window is jumped to the right, but the caret is at the same relative location, that "common substring" method could be useful for detecting when a "context reset" is actually a "context window jump".
Making good use of time-honored, reliable debugging methods - aka the humble console.warn
statement:
The messages are generated from ios-host.js
, setKeymanVal()
.
Once the context window shifts locations (upon reaching the new paragraph)... it appears that something is retriggering a context change.
So, what might that be?
First context change of pair
Second context change of pair
After further investigation, it appears that two Swift-side context updates are triggered:
textDocumentProxy
get propagated to the in-app TextView
, which itself triggers a context update. As the context window between textDocumentProxy
is now, uh, "less complete" than that of the TextView
, they appear "different" and trigger a full context reset within KMW.
Possibly related to #10204 / #10633 and the related underlying behaviors.
Being able to elaborate further may be tricky without further investigation, but I'm pretty sure we can all agree that the following behavior, after the newline, is wrong.
This is an issue against
master
that is merely perpetuated and/or changed, but not resolved, by #10589 at present.Motivated by https://github.com/keymanapp/keyman/pull/10589#issuecomment-1940600108:
Debugger-based inspection of the keyboard WebView indicates that, at the following frame:
... the KMW-internal context is:
... or similar. It appears that the attempt to resynchronize context for backspaces (see #10633) may be having adverse consequences as complicated new text is typed. The
textDocumentProxy
context window also seems to be acting pretty oddly here, but that's just an inference at this time.Other patterns sometimes results in all preceding context (having been maintained within the Web engine) suddenly being duplicated - something that is definitely concerning and erroneous behavior.
Repro:
8
key.a
a
.9
key.aê
ê
.8
key.aềa
à
's accent-mark on top the originalê
.Done using Simulator targeting iPhone 13 Pro, iOS 15.4. Interestingly, it doesn't appear to repro in Simulator targeting iPhone SE (3rd gen), iOS 16.2? At least... not the same sequence. That said, it was with an iPhone 13 Pro (non-simulated) where we saw weirdness in the tests for #10589, which led to discovery of this issue.