Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
fix(search): set focus back to input when search is cleared (#675)
Browse files Browse the repository at this point in the history
  • Loading branch information
annawen1 authored Jul 28, 2021
1 parent de54b5f commit 3f71051
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/search/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ class BXSearch extends FocusMixin(LitElement) {
})
);
this.value = '';

// set focus on back to input once search is cleared
const input = this.shadowRoot!.querySelector('input');
(input as HTMLElement).focus();
}
}

Expand Down

0 comments on commit 3f71051

Please sign in to comment.