Skip to content

Commit

Permalink
fix(FocusManager): rename selectNext(shouldSmoothOverride) and add to…
Browse files Browse the repository at this point in the history
… mdx docs
  • Loading branch information
ChrisArasin committed Feb 19, 2024
1 parent c74bc31 commit b5d23d9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ declare class FocusManager<
/**
* Selects next item. If this.wrapSelected=true, will select the first element in the list if focus is currently on the last item.
* emits the `selectedChange` signal
* @param forceSmoothValue allows setting the shouldSmooth value before the select update
* @param shouldSmoothOverride allows setting the shouldSmooth value before the select update
*/
selectNext(forceSmoothValue?: boolean): void;
selectNext(shouldSmoothOverride?: boolean): void;

/**
* Selects previous item. If this.wrapSelected=true, will select the last element in the list if focus is currently on the first item.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,11 @@ export default class FocusManager extends Base {
return false;
}

selectNext(forceSmoothValue) {
selectNext(shouldSmoothOverride) {
if (this._lazyItems && this._lazyItems.length) {
this._appendLazyItem(this._lazyItems.splice(0, 1)[0]);
}
this.shouldSmooth = forceSmoothValue ?? true;
this.shouldSmooth = shouldSmoothOverride ?? true;

const hasFocusable = !!(this.items || []).filter(i => !i.skipFocus).length;
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,6 @@ A no-op function that is called when `selectedIndex` is set. Can be overridden b

Selects the previous item in the FocusManager's children. If wrapSelected is true, it selects the last item if the focus is currently on the first item.

#### selectNext(): void
#### selectNext(shouldSmoothOverride?: boolean): void

Selects the next item in the FocusManager's children. If wrapSelected is true, it selects the first item if the focus is currently on the last item.
Selects the next item in the FocusManager's children. If wrapSelected is true, it selects the first item if the focus is currently on the last item. `shouldSmoothOverride` overrides the value of shouldSmooth before the next element is selected.

0 comments on commit b5d23d9

Please sign in to comment.