Skip to content

Commit

Permalink
fix(FocusManager): call super in _focus and _unfocus without smoothing
Browse files Browse the repository at this point in the history
  • Loading branch information
ImCoolNowRight committed Oct 11, 2023
1 parent f46c81c commit 5cfe270
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,20 @@ class Base extends lng.Component {
_update() {}

_focus() {
if (this.shouldSmooth === undefined) this.shouldSmooth = true;
super._focus();
this._updateShouldSmooth();
this.queueRequestUpdate();
}

_unfocus() {
super._unfocus();
this.queueRequestUpdate();
}

_updateShouldSmooth() {
if (this.shouldSmooth === undefined) this.shouldSmooth = true;
}

/**
* This method accepts a target component, patch object, and optional smooth object.
* If the component is visible, it will smooth in the smooth object, or fall back to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,16 @@ export default class FocusManager extends Base {
* Element/Pattern Components (Tile, Badge, etc.) would extend "BaseComponent" that does have focus/unfocus overrides
*/
_focus() {
super._focus();
this.items.forEach(item => (item.parentFocus = true));
}
_unfocus() {
super._unfocus();
this.items.forEach(item => (item.parentFocus = false));
}

_updateShouldSmooth() {}

_getFocused() {
const { selected } = this;
// Make sure we're focused on a component
Expand Down

0 comments on commit 5cfe270

Please sign in to comment.