Skip to content

Commit

Permalink
Trigger ESM build
Browse files Browse the repository at this point in the history
  • Loading branch information
josefarias committed Oct 14, 2024
1 parent 8694bdc commit 4ad5153
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions app/assets/javascripts/hotwire_combobox.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,7 @@ Combobox.Dialog = Base => class extends Base {

_resizeDialog = () => {
if (window.visualViewport) {
this.dialogTarget.style.setProperty(
"--hw-visual-viewport-height",
`${window.visualViewport.height}px`
);
this.dialogTarget.style.setProperty("--hw-visual-viewport-height", `${window.visualViewport.height}px`);
}
}

Expand Down Expand Up @@ -672,12 +669,7 @@ Combobox.Filtering = Base => class extends Base {
}

_filterSync() {
this._allFilterableOptionElements.forEach(
applyFilter(
this._fullQuery,
{ matching: this.filterableAttributeValue }
)
);
this._allFilterableOptionElements.forEach(applyFilter(this._fullQuery, { matching: this.filterableAttributeValue }));
}

_clearQuery() {
Expand Down Expand Up @@ -759,8 +751,7 @@ Combobox.FormField = Base => class extends Base {

get _hasEmptyFieldValue() {
if (this._isMultiselect) {
return this.hiddenFieldTarget.dataset.valueForMultiselect == "" ||
this.hiddenFieldTarget.dataset.valueForMultiselect == "undefined"
return this.hiddenFieldTarget.dataset.valueForMultiselect == "" || this.hiddenFieldTarget.dataset.valueForMultiselect == "undefined"
} else {
return this.hiddenFieldTarget.value === ""
}
Expand Down Expand Up @@ -844,13 +835,16 @@ Combobox.Multiselect = Base => class extends Base {

this._beforeClearingMultiselectQuery(async (display, value) => {
this._fullQuery = "";

this._filter("hw:multiselectSync");
this._requestChips(value);
this._addToFieldValue(value);

if (shouldReopen) {
await nextRepaint();
this.openByFocusing();
}

this._announceToScreenReader(display, "multi-selected. Press Shift + Tab, then Enter to remove.");
});
}
Expand Down Expand Up @@ -1723,20 +1717,13 @@ const concerns = [
];

class HwComboboxController extends Concerns(...concerns) {
static classes = [
"invalid",
"selected"
]

static classes = [ "invalid", "selected" ]
static targets = [
"announcer",
"combobox",
"chipDismisser",
"closer",
"dialog",
"dialogCombobox",
"dialogFocusTrap",
"dialogListbox",
"dialog", "dialogCombobox", "dialogFocusTrap", "dialogListbox",
"endOfOptionsStream",
"handle",
"hiddenField",
Expand Down Expand Up @@ -1798,8 +1785,7 @@ class HwComboboxController extends Concerns(...concerns) {
const callbackId = element.dataset.callbackId;

if (this._callbackAttemptsExceeded(callbackId)) {
this._dequeueCallback(callbackId);
return
return this._dequeueCallback(callbackId)
} else {
this._recordCallbackAttempt(callbackId);
}
Expand Down

0 comments on commit 4ad5153

Please sign in to comment.