Skip to content

Commit

Permalink
fix(core): Fixing AccountSelectInput sync issue (#8013)
Browse files Browse the repository at this point in the history
* fix(core): Fixing AccountSelectInput sync issue

* fix(core): Fixing AccountSelectInput sync issue

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
alanmquach and mergify[bot] committed Mar 10, 2020
1 parent 66126af commit 6ea3986
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ module(ACCOUNT_SELECT_COMPONENT, []).component('accountSelectField', {
'$timeout',
function($timeout: ITimeoutService) {
this.handleSelectChanged = (event: React.ChangeEvent<HTMLInputElement>) => {
// It seems event.persist() doesn't help here because the rerender updated target's value
// so we need to capture it before that happens.
const value = event.target.value;
$timeout(() => {
this.currentValue = this.component[this.field] = event.target.value;
this.currentValue = this.component[this.field] = value;
this.onChange && this.onChange();
});
};
Expand Down

0 comments on commit 6ea3986

Please sign in to comment.