Skip to content

Commit

Permalink
fix(components/listing-item): disabled items should not fire mouse ev…
Browse files Browse the repository at this point in the history
…ents #1947
  • Loading branch information
ickisIckis committed Aug 23, 2024
1 parent be58c9c commit 8e725dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
:host {
background-color: var(--prizm-background-fill-overlay);

&.disabled {
pointer-events: none;
}

.item-container {
display: flex;
align-items: center;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { ChangeDetectionStrategy, Component, HostBinding, Input } from '@angular/core';
import { PrizmAbstractTestId } from '../../abstract/interactive';
import { PolymorphOutletDirective } from '../../directives';
import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';
Expand All @@ -13,6 +13,7 @@ import { CommonModule } from '@angular/common';
imports: [CommonModule, PolymorphOutletDirective],
})
export class PrizmListingItemComponent extends PrizmAbstractTestId {
@HostBinding('class.disabled')
@Input()
get disabled() {
return this._disabled;
Expand All @@ -29,6 +30,7 @@ export class PrizmListingItemComponent extends PrizmAbstractTestId {
set selected(value: BooleanInput) {
this._selected = coerceBooleanProperty(value);
}

private _selected = false;

override readonly testId_ = 'ui_listing_item';
Expand Down

0 comments on commit 8e725dc

Please sign in to comment.