Revert highlight

This commit is contained in:
Sebastian Zoglowek 2025-11-27 14:26:29 +01:00
commit cab94ca67b
13 changed files with 49 additions and 4 deletions

View file

@ -4051,6 +4051,7 @@
};
var showLabel = config.appendGroupInSearch && isSearching;
var selectableChoices = false;
var highlightedEl = null;
var renderChoices = function (choices, withinGroup) {
if (isSearching) {
// sortByRank is used to ensure stable sorting, as scores are non-unique
@ -4072,6 +4073,9 @@
if (isSearching || !choice.selected) {
selectableChoices = true;
}
else if (!highlightedEl) {
highlightedEl = dropdownItem;
}
return index < choiceLimit;
});
};
@ -4119,6 +4123,7 @@
}
this._renderNotice(fragment);
this.choiceList.element.replaceChildren(fragment);
this._highlightChoice(highlightedEl);
};
Choices.prototype._renderItems = function () {
var _this = this;

File diff suppressed because one or more lines are too long

View file

@ -4045,6 +4045,7 @@ var Choices = /** @class */ (function () {
};
var showLabel = config.appendGroupInSearch && isSearching;
var selectableChoices = false;
var highlightedEl = null;
var renderChoices = function (choices, withinGroup) {
if (isSearching) {
// sortByRank is used to ensure stable sorting, as scores are non-unique
@ -4066,6 +4067,9 @@ var Choices = /** @class */ (function () {
if (isSearching || !choice.selected) {
selectableChoices = true;
}
else if (!highlightedEl) {
highlightedEl = dropdownItem;
}
return index < choiceLimit;
});
};
@ -4113,6 +4117,7 @@ var Choices = /** @class */ (function () {
}
this._renderNotice(fragment);
this.choiceList.element.replaceChildren(fragment);
this._highlightChoice(highlightedEl);
};
Choices.prototype._renderItems = function () {
var _this = this;

View file

@ -3572,6 +3572,7 @@
};
var showLabel = config.appendGroupInSearch && isSearching;
var selectableChoices = false;
var highlightedEl = null;
var renderChoices = function (choices, withinGroup) {
if (isSearching) {
// sortByRank is used to ensure stable sorting, as scores are non-unique
@ -3593,6 +3594,9 @@
if (isSearching || !choice.selected) {
selectableChoices = true;
}
else if (!highlightedEl) {
highlightedEl = dropdownItem;
}
return index < choiceLimit;
});
};
@ -3640,6 +3644,7 @@
}
this._renderNotice(fragment);
this.choiceList.element.replaceChildren(fragment);
this._highlightChoice(highlightedEl);
};
Choices.prototype._renderItems = function () {
var _this = this;

File diff suppressed because one or more lines are too long

View file

@ -3566,6 +3566,7 @@ var Choices = /** @class */ (function () {
};
var showLabel = config.appendGroupInSearch && isSearching;
var selectableChoices = false;
var highlightedEl = null;
var renderChoices = function (choices, withinGroup) {
if (isSearching) {
// sortByRank is used to ensure stable sorting, as scores are non-unique
@ -3587,6 +3588,9 @@ var Choices = /** @class */ (function () {
if (isSearching || !choice.selected) {
selectableChoices = true;
}
else if (!highlightedEl) {
highlightedEl = dropdownItem;
}
return index < choiceLimit;
});
};
@ -3634,6 +3638,7 @@ var Choices = /** @class */ (function () {
}
this._renderNotice(fragment);
this.choiceList.element.replaceChildren(fragment);
this._highlightChoice(highlightedEl);
};
Choices.prototype._renderItems = function () {
var _this = this;

View file

@ -2458,6 +2458,7 @@
};
var showLabel = config.appendGroupInSearch && isSearching;
var selectableChoices = false;
var highlightedEl = null;
var renderChoices = function (choices, withinGroup) {
if (isSearching) {
// sortByRank is used to ensure stable sorting, as scores are non-unique
@ -2479,6 +2480,9 @@
if (isSearching || !choice.selected) {
selectableChoices = true;
}
else if (!highlightedEl) {
highlightedEl = dropdownItem;
}
return index < choiceLimit;
});
};
@ -2526,6 +2530,7 @@
}
this._renderNotice(fragment);
this.choiceList.element.replaceChildren(fragment);
this._highlightChoice(highlightedEl);
};
Choices.prototype._renderItems = function () {
var _this = this;

File diff suppressed because one or more lines are too long

View file

@ -2452,6 +2452,7 @@ var Choices = /** @class */ (function () {
};
var showLabel = config.appendGroupInSearch && isSearching;
var selectableChoices = false;
var highlightedEl = null;
var renderChoices = function (choices, withinGroup) {
if (isSearching) {
// sortByRank is used to ensure stable sorting, as scores are non-unique
@ -2473,6 +2474,9 @@ var Choices = /** @class */ (function () {
if (isSearching || !choice.selected) {
selectableChoices = true;
}
else if (!highlightedEl) {
highlightedEl = dropdownItem;
}
return index < choiceLimit;
});
};
@ -2520,6 +2524,7 @@ var Choices = /** @class */ (function () {
}
this._renderNotice(fragment);
this.choiceList.element.replaceChildren(fragment);
this._highlightChoice(highlightedEl);
};
Choices.prototype._renderItems = function () {
var _this = this;

View file

@ -2417,6 +2417,7 @@
};
var showLabel = config.appendGroupInSearch && isSearching;
var selectableChoices = false;
var highlightedEl = null;
var renderChoices = function (choices, withinGroup) {
if (isSearching) {
// sortByRank is used to ensure stable sorting, as scores are non-unique
@ -2438,6 +2439,9 @@
if (isSearching || !choice.selected) {
selectableChoices = true;
}
else if (!highlightedEl) {
highlightedEl = dropdownItem;
}
return index < choiceLimit;
});
};
@ -2485,6 +2489,7 @@
}
this._renderNotice(fragment);
this.choiceList.element.replaceChildren(fragment);
this._highlightChoice(highlightedEl);
};
Choices.prototype._renderItems = function () {
var _this = this;

File diff suppressed because one or more lines are too long

View file

@ -2411,6 +2411,7 @@ var Choices = /** @class */ (function () {
};
var showLabel = config.appendGroupInSearch && isSearching;
var selectableChoices = false;
var highlightedEl = null;
var renderChoices = function (choices, withinGroup) {
if (isSearching) {
// sortByRank is used to ensure stable sorting, as scores are non-unique
@ -2432,6 +2433,9 @@ var Choices = /** @class */ (function () {
if (isSearching || !choice.selected) {
selectableChoices = true;
}
else if (!highlightedEl) {
highlightedEl = dropdownItem;
}
return index < choiceLimit;
});
};
@ -2479,6 +2483,7 @@ var Choices = /** @class */ (function () {
}
this._renderNotice(fragment);
this.choiceList.element.replaceChildren(fragment);
this._highlightChoice(highlightedEl);
};
Choices.prototype._renderItems = function () {
var _this = this;

View file

@ -975,6 +975,7 @@ class Choices {
const showLabel = config.appendGroupInSearch && isSearching;
let selectableChoices = false;
let highlightedEl: HTMLElement | null = null;
const renderChoices = (choices: ChoiceFull[], withinGroup: boolean): void => {
if (isSearching) {
// sortByRank is used to ensure stable sorting, as scores are non-unique
@ -1002,6 +1003,8 @@ class Choices {
fragment.appendChild(dropdownItem);
if (isSearching || !choice.selected) {
selectableChoices = true;
} else if (!highlightedEl) {
highlightedEl = dropdownItem;
}
return index < choiceLimit;
@ -1062,6 +1065,8 @@ class Choices {
this._renderNotice(fragment);
this.choiceList.element.replaceChildren(fragment);
this._highlightChoice(highlightedEl);
}
_renderItems(): void {