File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
packages/mgt-components/src/components/mgt-teams-channel-picker Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -716,17 +716,19 @@ export class MgtTeamsChannelPicker extends MgtTemplatedTaskComponent {
716716 event . stopImmediatePropagation ( ) ;
717717 const element = event . target as HTMLElement ;
718718 if ( element ) {
719- const expanded = element . getAttribute ( 'expanded' ) ;
720-
721- if ( expanded ) {
719+ const isExpanded = element . hasAttribute ( 'expanded' ) ;
720+ if ( isExpanded ) {
722721 element . removeAttribute ( 'expanded' ) ;
723722 } else {
724723 element . setAttribute ( 'expanded' , 'true' ) ;
725724 }
726- element . removeAttribute ( 'selected' ) ;
727- const hasId = element . getAttribute ( 'id' ) ;
725+
726+ // Only set selected attribute for channels (items with IDs)
727+ const hasId = element . hasAttribute ( 'id' ) ;
728728 if ( hasId ) {
729729 element . setAttribute ( 'selected' , 'true' ) ;
730+ } else {
731+ element . removeAttribute ( 'selected' ) ;
730732 }
731733 }
732734 } ;
You can’t perform that action at this time.
0 commit comments