Skip to content

Commit 66ee69e

Browse files
committed
fix(clipboard): missing await and duplicate style
1 parent 56dc5fa commit 66ee69e

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

packages/components/clipboard/src/components/osds-clipboard/core/controller.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class OdsClipboardController {
1313
const errorMessage = this.component.el.querySelector('[slot=error-message]')?.innerHTML;
1414

1515
try {
16-
writeOnClipboard(value);
16+
await writeOnClipboard(value);
1717
this.component.surfaceMessage = successMessage;
1818
if (this.component.surface && this.component.surfaceMessage !== "") {
1919
this.component.surface.opened = !this.component.surface.opened;
@@ -23,7 +23,7 @@ class OdsClipboardController {
2323
if (this.component.surface && this.component.surfaceMessage !== "") {
2424
this.component.surface.opened = !this.component.surface.opened;
2525
}
26-
return Promise.reject(error);
26+
throw error;
2727
}
2828
}
2929

packages/components/clipboard/src/components/osds-clipboard/osds-clipboard.scss

-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,5 @@ ocdk-surface {
3535
width: max-content;
3636
max-width: 300px;
3737
background: var(--white) 0% 0% no-repeat padding-box;
38-
background: #FFFFFF 0% 0% no-repeat padding-box;
3938
box-shadow: 0px 0px 6px #00000026;
4039
}

packages/components/clipboard/src/components/osds-clipboard/osds-clipboard.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ export class OsdsClipboard implements OdsClipboardAttribute, OdsClipboardEvent,
3434
/** @see OdsClipboardAttributes.disabled */
3535
@Prop({ reflect: true }) public disabled?: boolean = DEFAULT_ATTRIBUTE.disabled;
3636

37+
@State() surfaceMessage: string | undefined = "";
38+
3739
@Method()
3840
async closeSurface() {
3941
this.controller.closeSurface();
@@ -47,8 +49,6 @@ export class OsdsClipboard implements OdsClipboardAttribute, OdsClipboardEvent,
4749
this.controller.checkForClickOutside(event);
4850
}
4951

50-
@State() surfaceMessage: string | undefined = "";
51-
5252
handlerClick(): void {
5353
if (this.disabled) {
5454
return;

0 commit comments

Comments
 (0)