Skip to content

Commit

Permalink
fix(tile-select): fix click not firing in custom-elements build (#6665)
Browse files Browse the repository at this point in the history
**Related Issue:** #6185 

## Summary

Renames event handlers to prevent click listener not firing when the
tile-select area was clicked in the `dist-custom-elements` output
target. This seems like a Stencil bug caused when an event handler is
identical to its listened event name.
  • Loading branch information
jcfranco committed Mar 27, 2023
1 parent 8ee37d2 commit 71aa826
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/tile-select/tile-select.tsx
Expand Up @@ -203,7 +203,7 @@ export class TileSelect implements InteractiveComponent, LoadableComponent {
}

@Listen("click")
click(event: MouseEvent): void {
clickHandler(event: MouseEvent): void {
const target = event.target as HTMLElement;
const targets = ["calcite-tile", "calcite-tile-select"];
if (targets.includes(target.localName)) {
Expand All @@ -212,7 +212,7 @@ export class TileSelect implements InteractiveComponent, LoadableComponent {
}

@Listen("pointerenter")
mouseenter(): void {
pointerEnterHandler(): void {
if (this.input.localName === "calcite-radio-button") {
(this.input as HTMLCalciteRadioButtonElement).hovered = true;
}
Expand All @@ -222,7 +222,7 @@ export class TileSelect implements InteractiveComponent, LoadableComponent {
}

@Listen("pointerleave")
mouseleave(): void {
pointerLeaveHandler(): void {
if (this.input.localName === "calcite-radio-button") {
(this.input as HTMLCalciteRadioButtonElement).hovered = false;
}
Expand Down

0 comments on commit 71aa826

Please sign in to comment.