File tree 1 file changed +9
-0
lines changed
demos/browser/app/meetingV2/component
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ export default class Roster {
92
92
93
93
attendeeElement . className = 'list-group-item d-flex align-items-center gap-2' ;
94
94
attendeeElement . id = Roster . ATTENDEE_ELEMENT_PREFIX + attendeeId ;
95
+ attendeeElement . setAttribute ( "data-sort-key" , attendeeName ) ;
95
96
if ( allowAttendeeCapabilities ) {
96
97
attendeeElement . classList . add ( 'ps-2' ) ;
97
98
attendeeElement . appendChild ( attendeeCheckbox ) ;
@@ -101,6 +102,14 @@ export default class Roster {
101
102
102
103
const containerElement : HTMLUListElement = this . getContainerElement ( ) ;
103
104
containerElement . appendChild ( attendeeElement ) ;
105
+ this . sortRoster ( ) ;
106
+ }
107
+
108
+ private sortRoster ( ) {
109
+ const containerElement : HTMLUListElement = this . getContainerElement ( ) ;
110
+ const sortedChildren = Array . from ( containerElement . children )
111
+ . sort ( ( a , b ) => a . getAttribute ( "data-sort-key" ) ! . localeCompare ( b . getAttribute ( "data-sort-key" ) ! ) ) ;
112
+ sortedChildren . forEach ( child => containerElement . appendChild ( child ) ) ;
104
113
}
105
114
106
115
/**
You can’t perform that action at this time.
0 commit comments