Skip to content

Commit

Permalink
Merge pull request #9896 from mfo/US/fix-combobox-with-not-trimmed-op…
Browse files Browse the repository at this point in the history
…tion

fix(combobox): some old procedure still have options with trailing white spaces. ensure to trim selected value as well as options.value for better comparison
  • Loading branch information
mfo authored Jan 11, 2024
2 parents 87ba7d1 + 6c5f6dd commit e2cb833
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/javascript/shared/combobox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class Combobox {
}

const option = this.#visibleOptions.find(
(option) => option.value == maybeValue
(option) => option.value.trim() == maybeValue.trim()
);
if (!option) return false;

Expand Down

0 comments on commit e2cb833

Please sign in to comment.