typeahead: Default options to undefined instead of null.

This commit is contained in:
evykassirer 2024-03-18 12:09:39 -07:00 committed by Tim Abbott
parent 373671080d
commit 596233e14d
1 changed files with 2 additions and 4 deletions

View File

@ -162,8 +162,6 @@ const defaults = {
stopAdvance: false,
dropup: false,
advanceKeyCodes: [],
openInputFieldOnKeyUp: null,
closeInputFieldOnHide: null,
tabIsEnter: true,
};
@ -291,7 +289,7 @@ Typeahead.prototype = {
hide() {
this.$container.hide();
this.shown = false;
if (this.options.closeInputFieldOnHide !== null) {
if (this.options.closeInputFieldOnHide !== undefined) {
this.options.closeInputFieldOnHide();
}
return this;
@ -574,7 +572,7 @@ Typeahead.prototype = {
) {
return;
}
if (this.options.openInputFieldOnKeyUp !== null && !this.shown) {
if (this.options.openInputFieldOnKeyUp !== undefined && !this.shown) {
// If the typeahead isn't shown yet, the `lookup` call will open it.
// Here we make a callback to the input field before we open the
// lookahead in case it needs to make UI changes first (e.g. widening