-
Notifications
You must be signed in to change notification settings - Fork 358
Add a RemoveSelectAll and RemoveSelectNone config to multi-select #439
Add a RemoveSelectAll and RemoveSelectNone config to multi-select #439
Conversation
Thanks for putting this together @ces131! Should removing the select all also remove the select none behavior? Maybe we want a second option while we're here? |
If you'd like, I can add an additional option |
Yea i think we should just for completeness. thanks! |
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.
Sorry this review is coming in two pieces but I've been struggling to find the time. Anyway, we're almost there - one small tweak and this is good to go
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.
Looks good! thanks for updating the docs (and the ping 😅 )
No problem at all! Thanks for the review 😄 |
Adds a config to prevent users from selecting all of the survey options and a config to remove the "select none/de-select all" option in multiselect. Using
survey.WithRemoveSelectAll()
will disable the ability for the right arrow key to select all of the options. It will also remove the instructions from the multi-select prompt.Similarly,
survey.WithRemoveSelectNone()
will disable not allow a user to select none/de-select all options and the instruction won't show up in the prompt.Aurora Innovation has a patch with this work in their repo, and I figured I would make the change upstream. I filed a ticket quite awhile ago and finally got around to adding the change: #393
Test Plan
Ran all of the tests. Added a new test that verifies the correct prompt and checks that using the right arrow key doesn't select all the options and using the left arrow key doesn't de-select all the options.