I can't remove a selection using Select2 only with the keyboard

1,763 views
Skip to first unread message

alexis...@gmail.com

unread,
Apr 1, 2015, 10:37:11 AM4/1/15
to sel...@googlegroups.com
Hello,

I tried to find if this has already been discussed here but could not find it (maybe I used the wrong key words).

I'm having a problem for the inclusion of Select2 (2.4) in my website. Accessibility is a high priority for it and I cannot find a way to completely use Select2 through the keyboard only.

I only use "single selection" lists, with a placeholder and "allowClear" defined as true. In normal use (with the mouse), it works perfectly.

But, as I said, I can't find a way to remove a selection using only the keyboard.

I found a thread in 2012 on GitHub saying it was possible but I can't manage it.

I can open it (Space or Enter), make a selection (up and down arrows, then enter), but neither Delete nor Backspace allow me to remove a selection, whether the list is open or closed.

Is there something I'm doing wrong?

Thank you for your help.

Alexis

Kevin Brown

unread,
Apr 2, 2015, 9:15:26 AM4/2/15
to sel...@googlegroups.com
Hi Alexis,

The more recent versions of Select2 should be highly accessible, so this depends a lot on the version that is being used.
 
I tried to find if this has already been discussed here but could not find it (maybe I used the wrong key words).

 
I'm having a problem for the inclusion of Select2 (2.4) in my website. Accessibility is a high priority for it and I cannot find a way to completely use Select2 through the keyboard only.
 
I'm assuming you mean Select2 4.0.0.

I only use "single selection" lists, with a placeholder and "allowClear" defined as true. In normal use (with the mouse), it works perfectly.

But, as I said, I can't find a way to remove a selection using only the keyboard.

I found a thread in 2012 on GitHub saying it was possible but I can't manage it.
 
I'm not sure if it's possible to trigger the "x" for clearing the current selection, but this is something that needs to be implemented.

I can open it (Space or Enter), make a selection (up and down arrows, then enter), but neither Delete nor Backspace allow me to remove a selection, whether the list is open or closed.

You might be able to unselect the current one by doing CTRL + SPACE when the dropdown is over the currently selected option. This is usually how you unselect the currently selected option through the keyboard.

I've opened a ticket on GitHub about implementing Backspace and Delete for triggering the clear button on single selects: https://github.com/select2/select2/issues/3224

Kevin Brown

alexis...@gmail.com

unread,
Apr 2, 2015, 11:21:13 AM4/2/15
to sel...@googlegroups.com, ke...@kevinbrown.in
> I'm having a problem for the inclusion of Select2 (2.4) in my website. Accessibility is a high priority for it and I cannot find a way to completely use Select2 through the keyboard only.
>
>  
> I'm assuming you mean Select2 4.0.0.

Yes, you're right, it is 4.0.0. 4.0.0-rc.2 to be precise (I included the "2" at the end of "select2" for the version number; apparently, I am easily confused :-) )

> You might be able to unselect the current one by doing CTRL + SPACE when the dropdown is over the currently selected option. This is usually how you unselect the currently selected option through the keyboard.

I tried, but to no avail. I also tried Ctrl+Enter (and all the combinations I could think of). In fact, Ctrl+Space does not appear to work for basic "select" either.

> I've opened a ticket on GitHub about implementing Backspace and Delete for triggering the clear button on single selects: https://github.com/select2/select2/issues/3224

Thank you.


Alexis
Reply all
Reply to author
Forward
0 new messages