Skip to content

Commit

Permalink
form.field.ComboBox: does not hide the picker in case editable is fal…
Browse files Browse the repository at this point in the history
…se and opening it via a trigger click #5390
  • Loading branch information
tobiu committed Apr 12, 2024
1 parent 5acf083 commit cdb3934
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
29 changes: 15 additions & 14 deletions src/form/field/ComboBox.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ class ComboBox extends Picker {

// Filter resulting in something to show
if (store.getCount()) {
me.getPicker().hidden = false;
me.showPicker();

// List might not exist until the picker is created
const
Expand Down Expand Up @@ -620,19 +620,6 @@ class ComboBox extends Picker {
this.update()
}

/**
*
*/
onPickerTriggerClick() {
let me = this;

if (me.picker?.isVisible) {
me.picker.hidden = true
} else if (!me.disabled && !me.readOnly) {
me.doFilter(null)
}
}

/**
* Selecting a record, if required
* @param {Object[]} items
Expand Down Expand Up @@ -679,6 +666,20 @@ class ComboBox extends Picker {
me.list.selectItem(index)
}

/**
* @override
*/
togglePicker() {
let me = this,
{picker} = me;

if (picker?.hidden === false) {
picker.hidden = true
} else if (!me.disabled && !me.readOnly) {
me.doFilter(null)
}
}

/**
* Override this method as needed inside class extensions.
* @param {*} value
Expand Down
4 changes: 2 additions & 2 deletions src/form/field/Picker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ class Picker extends Text {
// We processed this event, and it should not proceed to ancestor components
data.cancelBubble = true;

// And no further listeers should be notified
return false;
// And no further listeners should be notified
return false
}
}

Expand Down

0 comments on commit cdb3934

Please sign in to comment.