mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-07 17:36:00 +00:00
fix(common): context reset on embedded caret shift
This commit is contained in:
parent
349d45c573
commit
fcc1eae8a5
2 changed files with 8 additions and 0 deletions
|
|
@ -240,9 +240,13 @@
|
|||
function updateKMSelectionRange(start, end) {
|
||||
var ta = document.getElementById('ta');
|
||||
var kmw = window['keyman'];
|
||||
var resetContext == (ta.selectionStart != pos || ta.selectionEnd != pos + length);
|
||||
ta.selectionStart = ta._KeymanWebSelectionStart = start;
|
||||
ta.selectionEnd = ta._KeymanWebSelectionEnd = end;
|
||||
kmw['setActiveElement'](ta);
|
||||
if(resetContext) {
|
||||
kmw.resetContext();
|
||||
}
|
||||
}
|
||||
|
||||
function oskCreateKeyPreview(x,y,w,h,t) {
|
||||
|
|
|
|||
|
|
@ -262,9 +262,13 @@
|
|||
function setCursorRange(pos, length) {
|
||||
var ta = document.getElementById('ta');
|
||||
var kmw = window['keyman'];
|
||||
var resetContext = (ta.selectionStart != pos || ta.selectionEnd != pos + length);
|
||||
ta.selectionStart = ta._KeymanWebSelectionStart = pos;
|
||||
ta.selectionEnd = ta._KeymanWebSelectionEnd = pos + length;
|
||||
kmw['setActiveElement'](ta);
|
||||
if(resetContext) {
|
||||
kmw.resetContext();
|
||||
}
|
||||
return ta.selectionEnd;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue