Skip to content

Commit

Permalink
for search input field, respond to onInput instead of onKeyUp
Browse files Browse the repository at this point in the history
  • Loading branch information
mlwilkerson committed May 30, 2024
1 parent 3488016 commit 98a8945
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -566,13 +566,7 @@ export class FaIconChooser {
return size(get(this, "kitMetadata.iconUploads"));
}

onKeyUp(e: any): void {
if (this.query === e.target.value) {
// If the user selects the contents of the query field using keystrokes,
// those selection keystrokes will not change the query value and should
// not trigger a new query.
return;
}
onSearchInputChange(e: any): void {
this.query = e.target.value;
if (size(this.query) === 0) {
this.setIcons(this.defaultIcons, this.iconUploadsAsIconUploadLookups());
Expand Down Expand Up @@ -644,7 +638,7 @@ export class FaIconChooser {
id="search"
class="rounded"
value={this.query}
onKeyUp={this.onKeyUp.bind(this)}
onInput={this.onSearchInputChange.bind(this)}
placeholder={this.searchInputPlaceholder ||
slotDefaults["search-field-placeholder"]}
>
Expand Down

0 comments on commit 98a8945

Please sign in to comment.