File tree Expand file tree Collapse file tree 5 files changed +61
-2
lines changed
carbon-react/src/components/MultiSelect
components/src/components/list-box
react/src/components/MultiSelect
styles/scss/components/list-box Expand file tree Collapse file tree 5 files changed +61
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ const items = [
2020 } ,
2121 {
2222 id : 'downshift-1-item-2' ,
23- text : 'Option 3' ,
23+ text : 'Option 3 - a disabled item' ,
24+ disabled : true ,
2425 } ,
2526 {
2627 id : 'downshift-1-item-3' ,
Original file line number Diff line number Diff line change @@ -658,6 +658,34 @@ $list-box-menu-width: rem(300px);
658658 color : $disabled-02 ;
659659 }
660660
661+ .#{$prefix } --list-box__menu-item [disabled ],
662+ .#{$prefix } --list-box__menu-item [disabled ] * ,
663+ .#{$prefix } --list-box__menu-item [disabled ]:hover {
664+ color : $disabled-02 ;
665+ cursor : not-allowed ;
666+ outline : none ;
667+ }
668+
669+ .#{$prefix } --list-box__menu-item [disabled ]:hover {
670+ background-color : revert ;
671+ }
672+
673+ .#{$prefix } --list-box__menu-item [disabled ]
674+ .#{$prefix } --checkbox-label ::before {
675+ border-color : $disabled-02 ;
676+ }
677+
678+ .#{$prefix } --list-box__menu-item [disabled ]
679+ .#{$prefix } --list-box__menu-item__option {
680+ border-top-color : $ui-03 ;
681+ }
682+
683+ .#{$prefix } --list-box__menu-item [disabled ]:hover
684+ + .#{$prefix } --list-box__menu-item
685+ .#{$prefix } --list-box__menu-item__option {
686+ border-top-color : $ui-03 ;
687+ }
688+
661689 .#{$prefix } --list-box.#{$prefix } --list-box--inline
662690 .#{$prefix } --list-box__menu-item__option {
663691 margin : 0 $carbon--spacing-03 ;
Original file line number Diff line number Diff line change @@ -32,7 +32,8 @@ const items = [
3232 } ,
3333 {
3434 id : 'downshift-1-item-2' ,
35- text : 'Option 3' ,
35+ text : 'Option 3 - a disabled item' ,
36+ disabled : true ,
3637 } ,
3738 {
3839 id : 'downshift-1-item-3' ,
Original file line number Diff line number Diff line change @@ -282,6 +282,7 @@ const MultiSelect = React.forwardRef(function MultiSelect(
282282 // we don't want Downshift to set aria-selected for us
283283 // we also don't want to set 'false' for reader verbosity's sake
284284 [ 'aria-selected' ] : isChecked ? true : null ,
285+ disabled : item ?. disabled ,
285286 } ) ;
286287 const itemText = itemToString ( item ) ;
287288 const isChecked =
Original file line number Diff line number Diff line change @@ -668,6 +668,34 @@ $list-box-menu-width: rem(300px);
668668 color : $text-disabled ;
669669 }
670670
671+ .#{$prefix } --list-box__menu-item [disabled ],
672+ .#{$prefix } --list-box__menu-item [disabled ] * ,
673+ .#{$prefix } --list-box__menu-item [disabled ]:hover {
674+ color : $text-disabled ;
675+ cursor : not-allowed ;
676+ outline : none ;
677+ }
678+
679+ .#{$prefix } --list-box__menu-item [disabled ]:hover {
680+ background-color : revert ;
681+ }
682+
683+ .#{$prefix } --list-box__menu-item [disabled ]
684+ .#{$prefix } --checkbox-label ::before {
685+ border-color : $text-disabled ;
686+ }
687+
688+ .#{$prefix } --list-box__menu-item [disabled ]
689+ .#{$prefix } --list-box__menu-item__option {
690+ border-top-color : $border-subtle ;
691+ }
692+
693+ .#{$prefix } --list-box__menu-item [disabled ]:hover
694+ + .#{$prefix } --list-box__menu-item
695+ .#{$prefix } --list-box__menu-item__option {
696+ border-top-color : $border-subtle ;
697+ }
698+
671699 .#{$prefix } --list-box.#{$prefix } --list-box--inline
672700 .#{$prefix } --list-box__menu-item__option {
673701 margin : 0 $spacing-03 ;
You can’t perform that action at this time.
0 commit comments