Skip to content

Commit

Permalink
Fix issue where expansion did not fire change event when checked chan…
Browse files Browse the repository at this point in the history
…ged. Closing #63.
  • Loading branch information
andreasbm committed Nov 2, 2019
1 parent 0557940 commit b3e9690
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/behavior/switch/switch-behavior.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export abstract class SwitchBehavior extends FormElementBehavior implements ISwi

// Defer the dispatching of the event until the UI on the grouped elements have updated.
requestAnimationFrame(() => {
this.dispatchEvent(new CustomEvent(SwitchBehaviorEvent.CHANGE, {composed: true, bubbles: true}))
this.dispatchEvent(new CustomEvent(SwitchBehaviorEvent.CHANGE, {composed: true, bubbles: true, detail: this.checked}))
});
}

Expand Down
1 change: 1 addition & 0 deletions src/lib/expansion/expansion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ export class Expansion extends RadioBehavior implements IExpansionProperties {
*/
protected toggle () {
this.checked = !this.checked;
this.dispatchChangeEvent();
}

/**
Expand Down

0 comments on commit b3e9690

Please sign in to comment.