Skip to content

Commit

Permalink
fix(select.tsx): fixes emitting fwChange before initialization for mu…
Browse files Browse the repository at this point in the history
…ltiselect
  • Loading branch information
Asif Ahmed committed Mar 9, 2021
1 parent f74e588 commit 3d11ba5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/components/select/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class Select {
@State() options = [];
@State() filteredOptions = [];
@State() hasFocus = false;
@State() didInit = false;
/**
* Label displayed on the interface, for the component.
*/
Expand Down Expand Up @@ -131,7 +132,9 @@ export class Select {
: this.value === option.value;
return option;
});
this.fwChange.emit({ value: this.value });
if (this.didInit) {
this.fwChange.emit({ value: this.value });
}
}
}

Expand Down Expand Up @@ -240,6 +243,7 @@ export class Select {

componentDidLoad() {
this.renderInput();
this.didInit = true;
}

@Method()
Expand Down

0 comments on commit 3d11ba5

Please sign in to comment.