refactor(web): setActivatingUI() => setMaintainingFocus()

This commit is contained in:
Joshua A. Horton 2023-04-19 09:27:13 +07:00
parent 2c78106ca4
commit 3ed754653f
6 changed files with 13 additions and 13 deletions

View file

@ -86,7 +86,7 @@ export class FocusAssistant {
*
* @param {(boolean|number)} state Activate (true,false)
*/
setActivatingUI(state: boolean) {
setMaintainingFocus(state: boolean) {
this.maintainingFocus = state ? true : false;
}
}

View file

@ -69,7 +69,7 @@ export default class ContextManager extends ContextManagerBase<BrowserConfigurat
// subclass.
// Required for the `sil_euro_latin` keyboard's desktop OSK/table to function properly.
this.focusAssistant.setActivatingUI(true);
this.focusAssistant.setMaintainingFocus(true);
dom.DOMEventHandlers.states._IgnoreNextSelChange = 100;
keyman.domManager.focusLastActiveElement();
dom.DOMEventHandlers.states._IgnoreNextSelChange = 0;

View file

@ -41,6 +41,6 @@ export class KeymanEngine extends KeymanEngineBase<ContextManager, KeyEventKeybo
* @param {(boolean|number)} state Activate (true,false)
*/
activatingUI(state: boolean | number) {
this.contextManager.focusAssistant.setActivatingUI(!!state);
this.contextManager.focusAssistant.setMaintainingFocus(!!state);
}
}

View file

@ -19,7 +19,7 @@ export function setupOskListeners(osk: OSKView, contextManager: ContextManager)
osk.on('hideRequested', (key) => {
if(osk) {
contextManager.focusAssistant.setActivatingUI(false);
contextManager.focusAssistant.setMaintainingFocus(false);
osk.startHide(true);
keyman.domManager.lastActiveElement = null;
}

View file

@ -80,7 +80,7 @@ export interface EventMap {
outputTarget.deadkeys().deleteMatched(); // Delete any matched deadkeys before continuing
if(!keyman.isEmbedded) { // To be done: handled through ContextManager
focusAssistant.setActivatingUI(true);
focusAssistant.setMaintainingFocus(true);
com.keyman.dom.DOMEventHandlers.states._IgnoreNextSelChange = 100;
keyman.domManager.focusLastActiveElement();
com.keyman.dom.DOMEventHandlers.states._IgnoreNextSelChange = 0;
@ -90,7 +90,7 @@ export interface EventMap {
// Now that processing is done, we can do a bit of post-processing, too.
// To be done: handled through ContextManager
focusAssistant.setActivatingUI(false); // I2498 - KeymanWeb OSK does not accept clicks in FF when using automatic UI
focusAssistant.setMaintainingFocus(false); // I2498 - KeymanWeb OSK does not accept clicks in FF when using automatic UI
return retVal;
} else {
return true;
@ -160,7 +160,7 @@ export interface EventMap {
keymanweb.domManager.focusLastActiveElement();
focusAssistant.restoringFocus = false;
focusAssistant.setActivatingUI(false);
focusAssistant.setMaintainingFocus(false);
// Alternate case using the same event:
if(isVisible && activeTarget) {
@ -187,7 +187,7 @@ export interface EventMap {
keymanweb.domManager.focusLastActiveElement();
focusAssistant.restoringFocus = false;
focusAssistant.setActivatingUI(false);
focusAssistant.setMaintainingFocus(false);
```
*/
resizeMove: (promise: Promise<void>) => void;
@ -203,10 +203,10 @@ export interface EventMap {
* Former handling, before this was an event:
```
// On event start
focusAssistant.setActivatingUI(true);
focusAssistant.setMaintainingFocus(true);
// On promise resolution
// noop // did not bother with `setActivatingUI(false)`. Possible bug?
// noop // did not bother with `setMaintainingFocus(false)`. Possible bug?
```
*/
pointerInteraction: (promise: Promise<void>) => void;
@ -380,7 +380,7 @@ export default abstract class OSKView extends EventEmitter<EventMap> implements
this._Box.onmouseleave = this._VKbdMouseLeave = (e) => {
this.mouseEnterPromise.resolve();
this.mouseEnterPromise = null;
// focusAssistant.setActivatingUI(false);
// focusAssistant.setMaintainingFocus(false);
};
}

View file

@ -104,7 +104,7 @@ interface EventMap {
outputTarget.deadkeys().deleteMatched(); // Delete any matched deadkeys before continuing
if(!keyman.isEmbedded) {
focusAssistant.setActivatingUI(true);
focusAssistant.setMaintainingFocus(true);
com.keyman.dom.DOMEventHandlers.states._IgnoreNextSelChange = 100;
keyman.domManager.focusLastActiveElement();
com.keyman.dom.DOMEventHandlers.states._IgnoreNextSelChange = 0;
@ -113,7 +113,7 @@ interface EventMap {
let retVal = !!keyman.core.processKeyEvent(Lkc, outputTarget);
// Now that processing is done, we can do a bit of post-processing, too.
focusAssistant.setActivatingUI(false); // I2498 - KeymanWeb OSK does not accept clicks in FF when using automatic UI
focusAssistant.setMaintainingFocus(false); // I2498 - KeymanWeb OSK does not accept clicks in FF when using automatic UI
return retVal;
} else {
return true;