Merge pull request #9 from ramonlsouza/18255x

keyboard move user - unassigned list
This commit is contained in:
André Castro 2023-07-10 10:43:44 -03:00 committed by GitHub
commit cca291a306
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -328,6 +328,11 @@ class BreakoutRoom extends PureComponent {
}
}
const unassignedUsers = document.getElementById('breakoutBox-0');
if (unassignedUsers) {
unassignedUsers.addEventListener('keydown', this.handleMoveEvent, true);
}
const { numberOfRooms } = this.state;
const { users } = this.props;
const { users: prevUsers } = prevProps;
@ -352,6 +357,10 @@ class BreakoutRoom extends PureComponent {
roomList.removeEventListener('keydown', this.handleMoveEvent, true);
}
}
const unassignedUsers = document.getElementById('breakoutBox-0');
if (unassignedUsers) {
unassignedUsers.removeEventListener('keydown', this.handleMoveEvent, true);
}
}
handleShiftUser(activeListSibling) {
@ -365,6 +374,12 @@ class BreakoutRoom extends PureComponent {
this.changeUserRoom(u.userId, users[index].room);
}
});
} else {
users.forEach((u, index) => {
if (`roomUserItem-${u.userId}` === document.activeElement.id) {
this.changeUserRoom(u.userId, 0);
}
});
}
}