Skip to content

Commit

Permalink
Fix/on keyboard input behavior (#539)
Browse files Browse the repository at this point in the history
* Fix input key mask enabled from set global properties

* Only set model param if model exists

* Remove redunant OnInputNotificaiton after showing keyboard

* Revert "Remove redunant OnInputNotificaiton after showing keyboard"

This reverts commit 08fc71b.

* Prevent redundant notification on activate

* Line break
  • Loading branch information
Jack-Byrne authored Mar 24, 2021
1 parent 5d73091 commit 1615bf9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 9 additions & 0 deletions app/model/sdl/Abstract/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,15 @@ SDL.SDLModel = Em.Object.extend({
});
}

if (name === "maskInputCharacters" &&
properties[name] === "USER_CHOICE_INPUT_KEY_MASK" &&
default_properties[name] !== "USER_CHOICE_INPUT_KEY_MASK") {
SDL.KeyboardController.set('maskCharacters', true);
if (SDL.SDLController.model) {
SDL.SDLController.model.set('maskInputCharactersUserChoice', true);
}
}

model.set('globalProperties.keyboardProperties.' + name, properties[name]);
} else {
model.set('globalProperties.keyboardProperties.' + name, default_properties[name]);
Expand Down
5 changes: 2 additions & 3 deletions app/view/sdl/shared/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ SDL.Keyboard = SDL.SDLAbstractView.create(
* @param {Object}
*/
activate: function(element) {
if (SDL.SDLController.model &&
SDL.SDLController.model.globalProperties.keyboardProperties &&
SDL.SDLController.model.globalProperties.keyboardProperties.maskInputCharacters == 'USER_CHOICE_INPUT_KEY_MASK') {
if (SDL.SDLController.model?.globalProperties?.keyboardProperties?.maskInputCharacters == 'USER_CHOICE_INPUT_KEY_MASK'
&& !SDL.KeyboardController.maskCharacters) {
SDL.KeyboardController.set('maskCharacters', true);
SDL.KeyboardController.updateInputMasking();
}
Expand Down

0 comments on commit 1615bf9

Please sign in to comment.