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 3535 width : var (--_icon-size );
3636 }
3737
38- [name = " trailing-icon" ]::slotted(md-icon) {
38+ [name = " remove- trailing-icon" ]::slotted(md-icon) {
3939 --md-icon-size : var (--_icon-size );
4040 color : inherit ;
4141 }
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ import {renderRemoveButton} from './trailing-icons.js';
2222 */
2323export class FilterChip extends MultiActionChip {
2424 @property ( { type : Boolean } ) elevated = false ;
25- @property ( { type : Boolean , attribute : 'has-trailing' } ) hasTrailing = false ;
25+ @property ( { type : Boolean } ) removable = false ;
2626 @property ( { type : Boolean , reflect : true } ) selected = false ;
2727
2828 /**
@@ -84,7 +84,7 @@ export class FilterChip extends MultiActionChip {
8484 }
8585
8686 protected override renderTrailingAction ( focusListener : EventListener ) {
87- if ( this . hasTrailing ) {
87+ if ( this . removable ) {
8888 return renderRemoveButton ( {
8989 focusListener,
9090 ariaLabel : this . ariaLabelRemove ,
Original file line number Diff line number Diff line change @@ -42,15 +42,6 @@ export abstract class MultiActionChip extends Chip {
4242 protected abstract readonly primaryAction : HTMLElement | null ;
4343 protected abstract readonly trailingAction : HTMLElement | null ;
4444
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-
5445 constructor ( ) {
5546 super ( ) ;
5647 this . handleTrailingActionFocus = this . handleTrailingActionFocus . bind ( this ) ;
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export function renderRemoveButton({
3434 @focus=${ focusListener } >
3535 < md-focus-ring part ="trailing-focus-ring "> </ md-focus-ring >
3636 < md-ripple ?disabled =${ disabled } > </ md-ripple >
37- < slot name ="trailing-icon " class ="trailing icon ">
37+ < slot name ="remove- trailing-icon " class ="trailing icon ">
3838 < svg viewBox ="0 96 960 960 " aria-hidden ="true ">
3939 < path
4040 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({
4646}
4747
4848function handleRemoveClick ( this : MultiActionChip , event : Event ) {
49- if ( this . disabled || this . hasSlottedTrailingIcon ) {
49+ if ( this . disabled ) {
5050 return ;
5151 }
5252
You can’t perform that action at this time.
0 commit comments