Skip to content

Commit

Permalink
remove dead logic
Browse files Browse the repository at this point in the history
  • Loading branch information
claviska committed Jul 18, 2023
1 parent 9562718 commit c628185
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
13 changes: 0 additions & 13 deletions src/components/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,6 @@ export default class SlButton extends ShoelaceElement implements ShoelaceFormCon
return '';
}

constructor() {
super();
this.addEventListener('click', this.handleHostClick);
}

firstUpdated() {
if (this.isButton()) {
this.formControlController.updateValidity();
Expand All @@ -198,14 +193,6 @@ export default class SlButton extends ShoelaceElement implements ShoelaceFormCon
}
}

private handleHostClick = (event: MouseEvent) => {
// Prevent the click event from being emitted when the button is disabled or loading
if (this.disabled || this.loading) {
event.preventDefault();
event.stopImmediatePropagation();
}
};

private handleInvalid(event: Event) {
this.formControlController.setValidity(false);
this.formControlController.emitInvalidEvent(event);
Expand Down
13 changes: 0 additions & 13 deletions src/components/menu-item/menu-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ export default class SlMenuItem extends ShoelaceElement {
/** Draws the menu item in a disabled state, preventing selection. */
@property({ type: Boolean, reflect: true }) disabled = false;

constructor() {
super();
this.addEventListener('click', this.handleHostClick);
}

private handleDefaultSlotChange() {
const textLabel = this.getTextLabel();

Expand All @@ -69,14 +64,6 @@ export default class SlMenuItem extends ShoelaceElement {
}
}

private handleHostClick = (event: MouseEvent) => {
// Prevent the click event from being emitted when the button is disabled or loading
if (this.disabled) {
event.preventDefault();
event.stopImmediatePropagation();
}
};

@watch('checked')
handleCheckedChange() {
// For proper accessibility, users have to use type="checkbox" to use the checked attribute
Expand Down

0 comments on commit c628185

Please sign in to comment.