Skip to content

Commit

Permalink
(web-components) Fix issue loading Color Explorer values
Browse files Browse the repository at this point in the history
  • Loading branch information
bheston committed Jun 3, 2022
1 parent d32031b commit a9be58e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "(web-components) Fix issue loading Color Explorer values",
"packageName": "@fluentui/web-components",
"email": "47367562+bheston@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -424,16 +424,11 @@ export class AppColorBlock extends FASTElement {

@attr color: string;
private colorChanged(): void {
this.updateColor();
DOM.queueUpdate(() => this.updateColor());
}

@attr({ attribute: 'layer-name' }) layerName?: string;

public connectedCallback() {
super.connectedCallback();
DOM.queueUpdate(() => this.updateColor());
}

private updateColor(): void {
if (this.color && this.$fastController.isConnected) {
const color = parseColorHexRGB(this.color)!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ export class AppSwatch extends FoundationElement {
public connectedCallback() {
super.connectedCallback();

const fillColorChangeHandler = () => {
this.updateObservables();
};

fillColor.subscribe(
{
handleChange: fillColorChangeHandler,
},
this,
);

this.updateObservables();
}

Expand Down

0 comments on commit a9be58e

Please sign in to comment.