@@ -444,7 +444,7 @@ export class MultipleSelectInstance {
444444 const selectName = this . elm . getAttribute ( 'name' ) || this . options . name || '' ;
445445 this . selectAllParentElm = createDomElement ( 'div' , { className : 'ms-select-all' , dataset : { key : 'select_all' } } ) ;
446446 const saLabelElm = document . createElement ( 'label' ) ;
447- const saIconClass = this . isAllSelected ? 'ms-icon-check' : this . isPartiallyAllSelected ? 'ms-icon-minus ' : 'ms-icon- uncheck' ;
447+ const saIconClass = this . isAllSelected ? 'ms-icon-check' : `ms-icon- ${ this . isPartiallyAllSelected ? 'partial-all ' : 'uncheck' } ` ;
448448 const selectAllIconClass = `ms-icon ${ saIconClass } ` ;
449449 const saIconContainerElm = createDomElement ( 'div' , { className : 'icon-checkbox-container' } , saLabelElm ) ;
450450 createDomElement (
@@ -635,6 +635,12 @@ export class MultipleSelectInstance {
635635 if ( isSingleWithoutRadioIcon ) {
636636 itemOrGroupBlock = inputCheckboxStruct ;
637637 } else {
638+ // determine if it's an optgroup and the group has a partial selection
639+ let hasPartialGroupSelected = true ;
640+ if ( 'children' in dataRow && ( dataRow as OptGroupRowData ) . children . some ( child => child ?. selected ) ) {
641+ hasPartialGroupSelected = true ;
642+ }
643+
638644 itemOrGroupBlock = {
639645 tagName : 'div' ,
640646 props : {
@@ -645,7 +651,7 @@ export class MultipleSelectInstance {
645651 {
646652 tagName : 'div' ,
647653 props : {
648- className : `ms-icon ${ isChecked ? ( type === 'radio' ? 'ms-icon-radio' : 'ms-icon-check' ) : ' ms-icon-uncheck'} ` ,
654+ className : `ms-icon ${ isChecked ? ( type === 'radio' ? 'ms-icon-radio' : 'ms-icon-check' ) : ` ms-icon-${ hasPartialGroupSelected ? 'partial-group' : ' uncheck'} ` } ` ,
649655 } ,
650656 } ,
651657 ] ,
@@ -1575,6 +1581,11 @@ export class MultipleSelectInstance {
15751581 const closestLiElm = inputElm . closest ( 'li' ) ;
15761582 const iconDivElm = closestLiElm ?. querySelector ( '.icon-checkbox-container div' ) ;
15771583 if ( closestLiElm ) {
1584+ // determine if it's an optgroup and the group has a partial selection
1585+ let hasPartialGroupSelected = false ;
1586+ if ( 'children' in row && ( row as OptGroupRowData ) . children . some ( child => child ?. selected ) ) {
1587+ hasPartialGroupSelected = true ;
1588+ }
15781589 if ( row . selected && ! closestLiElm . classList . contains ( 'selected' ) ) {
15791590 closestLiElm . classList . add ( 'selected' ) ;
15801591 closestLiElm . ariaSelected = 'true' ;
@@ -1585,7 +1596,7 @@ export class MultipleSelectInstance {
15851596 closestLiElm . classList . remove ( 'selected' ) ;
15861597 closestLiElm . ariaSelected = 'false' ;
15871598 if ( iconDivElm ) {
1588- iconDivElm . className = ' ms-icon ms-icon-uncheck';
1599+ iconDivElm . className = ` ms-icon ms-icon-${ hasPartialGroupSelected ? 'partial-group' : ' uncheck'} ` ;
15891600 }
15901601 }
15911602 }
@@ -1602,7 +1613,7 @@ export class MultipleSelectInstance {
16021613 if ( this . isAllSelected ) {
16031614 iconClass = 'ms-icon-check' ;
16041615 } else if ( this . isPartiallyAllSelected ) {
1605- iconClass = 'ms-icon-minus ' ;
1616+ iconClass = 'ms-icon-partial-all ' ;
16061617 } else {
16071618 iconClass = 'ms-icon-uncheck' ;
16081619 }
0 commit comments