Skip to content

Commit

Permalink
change files (#28500)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdholt authored and radium-v committed May 8, 2024
1 parent 1f4594d commit 6d6d6fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "fix(web-components): check if component is connected before calling setAttribute in attribute changed callback",
"packageName": "@fluentui/web-components",
"email": "chhol@microsoft.com",
"dependentChangeType": "patch"
}
4 changes: 4 additions & 0 deletions packages/web-components/src/toggle-button/toggle-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ export class ToggleButton extends Button {
@observable
public checked: boolean = false;
protected checkedChanged(prev: boolean | undefined, next: boolean): void {
if (!this.$fastController.isConnected) {
return;
}

if (!this.dirtyChecked) {
this.dirtyChecked = true;
}
Expand Down

0 comments on commit 6d6d6fe

Please sign in to comment.