mirror of
https://github.com/discourse/discourse.git
synced 2025-02-18 01:05:00 +00:00
DEV: simplify logic when selecting an undefined value (#14225)
This commit is contained in:
parent
ee7809e8a8
commit
36a81435cf
@ -783,14 +783,7 @@ export default Component.extend(
|
|||||||
|
|
||||||
select(value, item) {
|
select(value, item) {
|
||||||
if (!isPresent(value)) {
|
if (!isPresent(value)) {
|
||||||
if (!this.validateSelect(this.selectKit.highlighted)) {
|
this._onClearSelection();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.selectKit.change(
|
|
||||||
this.getValue(this.selectKit.highlighted),
|
|
||||||
this.selectKit.highlighted
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
const existingItem = this.findValue(this.mainCollection, item);
|
const existingItem = this.findValue(this.mainCollection, item);
|
||||||
if (existingItem) {
|
if (existingItem) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user