Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
driskull committed Oct 3, 2024
1 parent 1fac4b8 commit e0157aa
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,17 @@ export class SortHandle implements LoadableComponent, T9nComponent, InteractiveC
*/
@Prop({ reflect: true, mutable: true }) open = false;

@Watch("open")
openHandler(): void {
if (this.disabled) {
this.open = false;
return;
}

// we set the property instead of the attribute to ensure dropdown's open/close events are emitted properly
this.dropdownEl.open = this.open;
}

/** Specifies the size of the component. */
@Prop({ reflect: true }) scale: Scale = "m";

Expand Down Expand Up @@ -232,6 +243,7 @@ export class SortHandle implements LoadableComponent, T9nComponent, InteractiveC

private setDropdownEl = (el: HTMLCalciteDropdownElement): void => {
this.dropdownEl = el;
this.openHandler();
};

private getLabel(): string {
Expand Down Expand Up @@ -314,7 +326,6 @@ export class SortHandle implements LoadableComponent, T9nComponent, InteractiveC
onCalciteDropdownBeforeOpen={this.handleBeforeOpen}
onCalciteDropdownClose={this.handleClose}
onCalciteDropdownOpen={this.handleOpen}
open={open}
overlayPositioning={overlayPositioning}
placement={placement}
ref={this.setDropdownEl}
Expand Down

0 comments on commit e0157aa

Please sign in to comment.