@@ -451,7 +451,7 @@ export class ChipList extends Component<HTMLElement> implements INotifyPropertyC
451
451
452
452
private setAttributes ( ) : void {
453
453
if ( this . type === 'chip' ) {
454
- this . enabled ? this . element . tabIndex = 0 : this . element . setAttribute ( 'aria-disabled' , 'true' ) ;
454
+ if ( this . enabled ) this . element . tabIndex = 0 ;
455
455
this . element . setAttribute ( 'role' , 'option' ) ;
456
456
} else {
457
457
this . element . classList . add ( classNames . chipSet ) ;
@@ -497,8 +497,10 @@ export class ChipList extends Component<HTMLElement> implements INotifyPropertyC
497
497
if ( fieldsData . value ) {
498
498
wrapper . setAttribute ( 'data-value' , fieldsData . value . toString ( ) ) ;
499
499
}
500
- if ( ! fieldsData . enabled ) {
500
+ if ( fieldsData . enabled ) { wrapper . setAttribute ( 'aria-disabled' , 'false' ) ; }
501
+ else {
501
502
wrapper . removeAttribute ( 'tabindex' ) ;
503
+ wrapper . setAttribute ( 'aria-disabled' , 'true' ) ;
502
504
}
503
505
append ( chipArray , wrapper ) ;
504
506
chipListArray . push ( wrapper ) ;
@@ -570,9 +572,11 @@ export class ChipList extends Component<HTMLElement> implements INotifyPropertyC
570
572
/**
571
573
* A function that finds chip based on given input.
572
574
*
573
- * @param {number | HTMLElement } fields - We can pass index number or element of chip.
574
575
* {% codeBlock src='chips/find/index.md' %}{% endcodeBlock %}
575
576
*
577
+ * @param {number | HTMLElement } fields - We can pass index number or element of chip.
578
+ *
579
+ * @returns {void }
576
580
*/
577
581
578
582
public find ( fields : number | HTMLElement ) : ChipDataArgs {
@@ -595,10 +599,12 @@ export class ChipList extends Component<HTMLElement> implements INotifyPropertyC
595
599
/**
596
600
* Allows adding the chip item(s) by passing a single or array of string, number, or ChipModel values.
597
601
*
602
+ * {% codeBlock src='chips/add/index.md' %}{% endcodeBlock %}
603
+ *
598
604
* @param {string[] | number[] | ChipModel[] | string | number | ChipModel } chipsData - We can pass array of string or
599
605
* array of number or array of chip model or string data or number data or chip model.
600
- * {% codeBlock src='chips/add/index.md' %}{% endcodeBlock %}
601
606
*
607
+ * @returns {void }
602
608
* @deprecated
603
609
*/
604
610
@@ -614,10 +620,12 @@ export class ChipList extends Component<HTMLElement> implements INotifyPropertyC
614
620
/**
615
621
* Allows selecting the chip item(s) by passing a single or array of string, number, or ChipModel values.
616
622
*
623
+ * {% codeBlock src='chips/select/index.md' %}{% endcodeBlock %}
624
+ *
617
625
* @param {number | number[] | HTMLElement | HTMLElement[] } fields - We can pass number or array of number
618
626
* or chip element or array of chip element.
619
- * {% codeBlock src='chips/select/index.md' %}{% endcodeBlock %}
620
627
*
628
+ * @returns {void }
621
629
*/
622
630
623
631
public select ( fields : number | number [ ] | HTMLElement | HTMLElement [ ] | string [ ] , selectionType ?: selectionType ) : void {
@@ -686,10 +694,12 @@ export class ChipList extends Component<HTMLElement> implements INotifyPropertyC
686
694
/**
687
695
* Allows removing the chip item(s) by passing a single or array of string, number, or ChipModel values.
688
696
*
697
+ * {% codeBlock src='chips/remove/index.md' %}{% endcodeBlock %}
698
+ *
689
699
* @param {number | number[] | HTMLElement | HTMLElement[] } fields - We can pass number or array of number
690
700
* or chip element or array of chip element.
691
- * {% codeBlock src='chips/remove/index.md' %}{% endcodeBlock %}
692
701
*
702
+ * @returns {void }
693
703
*/
694
704
695
705
public remove ( fields : number | number [ ] | HTMLElement | HTMLElement [ ] ) : void {
@@ -714,8 +724,10 @@ export class ChipList extends Component<HTMLElement> implements INotifyPropertyC
714
724
715
725
/**
716
726
* Returns the selected chip(s) data.
727
+ *
717
728
* {% codeBlock src='chips/getSelectedChips/index.md' %}{% endcodeBlock %}
718
729
*
730
+ * @returns {void }
719
731
*/
720
732
721
733
public getSelectedChips ( ) : SelectedItem | SelectedItems {
@@ -906,8 +918,10 @@ export class ChipList extends Component<HTMLElement> implements INotifyPropertyC
906
918
907
919
/**
908
920
* Removes the component from the DOM and detaches all its related event handlers. Also, it removes the attributes and classes.
921
+ *
909
922
* {% codeBlock src='chips/destroy/index.md' %}{% endcodeBlock %}
910
923
*
924
+ * @returns {void }
911
925
*/
912
926
913
927
public destroy ( ) : void {
0 commit comments