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

Commit

Permalink
fix: Replace shadowroot querying with textInput reference. (#799)
Browse files Browse the repository at this point in the history
* removed shadowRoot reference.

* added ref to input

Co-authored-by: Matt Driscoll <[email protected]>
  • Loading branch information
pr3tori4n and driskull authored Feb 4, 2020
1 parent a1e1e61 commit 5ee3f08
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/calcite-filter/calcite-filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ export class CalciteFilter {

@State() empty = true;

textInput: HTMLInputElement;

// --------------------------------------------------------------------------
//
// Events
Expand Down Expand Up @@ -97,7 +99,7 @@ export class CalciteFilter {
};

clear = (): void => {
this.el.shadowRoot.querySelector("input").value = "";
this.textInput.value = "";
this.empty = true;
this.calciteFilterChange.emit(this.data);
};
Expand All @@ -118,6 +120,7 @@ export class CalciteFilter {
placeholder={this.textPlaceholder}
onInput={this.inputHandler}
aria-label={this.textLabel || TEXT.filterLabel}
ref={(el) => (this.textInput = el as HTMLInputElement)}
/>
<div class={CSS.searchIcon}>
<calcite-icon scale="s" icon={ICONS.search} />
Expand Down

0 comments on commit 5ee3f08

Please sign in to comment.