Skip to content

Commit

Permalink
fix: catch both slug and ai-label in event handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
annawen1 committed Oct 22, 2024
1 parent 3176eb1 commit c37c2a6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class CDSMultiSelect extends CDSDropdown {
} else if (
!(event.target as HTMLElement)?.matches(
(this.constructor as typeof CDSMultiSelect).aiLabelItem
) ||
) &&
// remove reference to slug in v12
!(event.target as HTMLElement)?.matches(
(this.constructor as typeof CDSMultiSelect).slugItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class CDSRadioButton extends HostListenerMixin(FocusMixin(LitElement)) {
if (
!(event.target as HTMLElement).matches(
(this.constructor as typeof CDSRadioButton)?.aiLabelItem
) ||
) &&
!(event.target as HTMLElement).matches(
(this.constructor as typeof CDSRadioButton)?.slugItem
)
Expand Down Expand Up @@ -180,7 +180,7 @@ class CDSRadioButton extends HostListenerMixin(FocusMixin(LitElement)) {
if (
!(event.target as HTMLElement).matches(
(this.constructor as typeof CDSRadioButton)?.aiLabelItem
) ||
) &&
!(event.target as HTMLElement).matches(
(this.constructor as typeof CDSRadioButton)?.slugItem
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ class CDSSelectableTile extends HostListenerMixin(FocusMixin(LitElement)) {
(key === 'Enter' &&
!(event.target as HTMLElement)?.matches(
(this.constructor as typeof CDSSelectableTile).aiLabelItem
)) ||
!(event.target as HTMLElement)?.matches(
(this.constructor as typeof CDSSelectableTile).slugItem
)
) &&
!(event.target as HTMLElement)?.matches(
(this.constructor as typeof CDSSelectableTile).slugItem
))
) {
this.selected = !this.selected;
}
Expand Down

0 comments on commit c37c2a6

Please sign in to comment.