Skip to content

fix(material/select): incorrect default typeahead debounce time #21253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/material/select/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ export abstract class _MatSelectBase<C> extends _MatSelectMixinBase implements A
set typeaheadDebounceInterval(value: number) {
this._typeaheadDebounceInterval = coerceNumberProperty(value);
}
private _typeaheadDebounceInterval = this._defaultOptions?.typeaheadDebounceInterval ?? 0;
private _typeaheadDebounceInterval: number;

/**
* Function used to sort the values in a select in multiple mode.
Expand Down Expand Up @@ -504,6 +504,12 @@ export abstract class _MatSelectBase<C> extends _MatSelectMixinBase implements A
this.ngControl.valueAccessor = this;
}

// Note that we only want to set this when the defaults pass it in, otherwise it should
// stay as `undefined` so that it falls back to the default in the key manager.
if (_defaultOptions?.typeaheadDebounceInterval != null) {
this._typeaheadDebounceInterval = _defaultOptions.typeaheadDebounceInterval;
}

this._scrollStrategyFactory = scrollStrategyFactory;
this._scrollStrategy = this._scrollStrategyFactory();
this.tabIndex = parseInt(tabIndex) || 0;
Expand Down