Skip to content

Commit

Permalink
Update elsa-dropdown-property.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
sfmskywalker committed Jun 23, 2022
1 parent 77a322c commit d30d72e
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,11 @@ export class ElsaDropdownProperty {
this.currentValue = optionIsObject ? firstOption.value : firstOption.toString();
}

// Dispatch event to the next dependent input, if any.
currentSelectList.dispatchEvent(new Event("change"));
// Dispatch change event so that dependent dropdown elements refresh.
// Do this after the current component has re-rendered, otherwise the current value will be sent to the backend, which is outdated.
requestAnimationFrame(() => {
currentSelectList.dispatchEvent(new Event("change"));
});
}

private awaitElement = async selector => {
Expand Down

0 comments on commit d30d72e

Please sign in to comment.