File tree Expand file tree Collapse file tree 4 files changed +5
-14
lines changed Expand file tree Collapse file tree 4 files changed +5
-14
lines changed Original file line number Diff line number Diff line change 35
35
width : var (--_icon-size );
36
36
}
37
37
38
- [name = " trailing-icon" ]::slotted(md-icon) {
38
+ [name = " remove- trailing-icon" ]::slotted(md-icon) {
39
39
--md-icon-size : var (--_icon-size );
40
40
color : inherit ;
41
41
}
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ import {renderRemoveButton} from './trailing-icons.js';
22
22
*/
23
23
export class FilterChip extends MultiActionChip {
24
24
@property ( { type : Boolean } ) elevated = false ;
25
- @property ( { type : Boolean , attribute : 'has-trailing' } ) hasTrailing = false ;
25
+ @property ( { type : Boolean } ) removable = false ;
26
26
@property ( { type : Boolean , reflect : true } ) selected = false ;
27
27
28
28
/**
@@ -84,7 +84,7 @@ export class FilterChip extends MultiActionChip {
84
84
}
85
85
86
86
protected override renderTrailingAction ( focusListener : EventListener ) {
87
- if ( this . hasTrailing ) {
87
+ if ( this . removable ) {
88
88
return renderRemoveButton ( {
89
89
focusListener,
90
90
ariaLabel : this . ariaLabelRemove ,
Original file line number Diff line number Diff line change @@ -42,15 +42,6 @@ export abstract class MultiActionChip extends Chip {
42
42
protected abstract readonly primaryAction : HTMLElement | null ;
43
43
protected abstract readonly trailingAction : HTMLElement | null ;
44
44
45
- /**
46
- * Getter used to determine if the user provided a trailing icon or not.
47
- */
48
- get hasSlottedTrailingIcon ( ) {
49
- const slot = this . shadowRoot . querySelector ( 'slot[name="trailing-icon"]' ) as HTMLSlotElement ;
50
- // Default slot is not counted as one element.
51
- return slot . assignedElements ( ) . length > 0 ;
52
- }
53
-
54
45
constructor ( ) {
55
46
super ( ) ;
56
47
this . handleTrailingActionFocus = this . handleTrailingActionFocus . bind ( this ) ;
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export function renderRemoveButton({
34
34
@focus=${ focusListener } >
35
35
< md-focus-ring part ="trailing-focus-ring "> </ md-focus-ring >
36
36
< md-ripple ?disabled =${ disabled } > </ md-ripple >
37
- < slot name ="trailing-icon " class ="trailing icon ">
37
+ < slot name ="remove- trailing-icon " class ="trailing icon ">
38
38
< svg viewBox ="0 96 960 960 " aria-hidden ="true ">
39
39
< path
40
40
d ="m249 849-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231-231 231Z " />
@@ -46,7 +46,7 @@ export function renderRemoveButton({
46
46
}
47
47
48
48
function handleRemoveClick ( this : MultiActionChip , event : Event ) {
49
- if ( this . disabled || this . hasSlottedTrailingIcon ) {
49
+ if ( this . disabled ) {
50
50
return ;
51
51
}
52
52
You can’t perform that action at this time.
0 commit comments