New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unchecked the agents when you click outside #2907
Conversation
@@ -498,6 +498,9 @@ export class MultipleAgentSelector extends Component { | |||
size='15' | |||
multiple | |||
onChange={(e) => { | |||
document.getElementById("wzMultipleSelectorRight").childNodes.forEach(option => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you put all of this code in a new method and maybe you can reuse the method with param wzMultipleSelectorRight/wzMultipleSelectorLeft
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
unselectLeftRight(element) { | ||
switch (element) { | ||
case 'left': | ||
return document.getElementById("wzMultipleSelectorLeft").childNodes.forEach(option => { | ||
option.selected = false | ||
}) | ||
case 'right': | ||
return document.getElementById("wzMultipleSelectorRight").childNodes.forEach(option => { | ||
option.selected = false | ||
}) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use the container id
as the param. You could simplify to:
unselectElementsOfSelectByID(containerID) {
document.getElementById(containerID).selectedOptions.forEach(option => {
option.selected = false
});
}
A more descriptive name for the function will better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Hi team, this PR solved the problem that agents were not unchecked when switching from Available agents to Current agents in
Management > Groups
.Closes #2889