1
0
mirror of synced 2024-11-23 13:36:01 +03:00
Commit Graph

16 Commits

Author SHA1 Message Date
Kevin Brown
cdfa0499f4 Accessibility matches better
Now the accessibility for the single select box better matches what
is picked up for a native select.

This fixes an issue with us always setting `aria-activedescendant`,
which caused Orca to always say the full path to the selected
result, instead of saying that the box was a combobox with a
selection. This means that the `aria-activedescendant` attribute
will now only be set when the dropdown is open.

This also switches the results list from a listbox to a tree, which
is what Firefox tells screen readers that a standard select is.
Combined with a change to use `role=group` and `aria-label` for
option group labels, screen readers will now announce the group
that they are in as well.
2014-10-21 21:44:00 -04:00
Kevin Brown
7c8601d33b Better accessibility for results
Options are correctly called out as focus moves around the results
list.
2014-10-21 21:44:00 -04:00
Kevin Brown
9102cf9473 Fixed keyboard scrolling
Now when scrolling through results with the keyboard, the
highlighted option will always be visible.
2014-10-21 21:44:00 -04:00
Kevin Brown
cc9419928e Working on accessibility
This makes quite a few changes, one of the major ones being the
removal of classes for marking options as selected or selectable,
and instead using the ARIA attributes which should already be
present.
2014-10-21 21:44:00 -04:00
Kevin Brown
a07fc21815 Added remove button on multiple select choices 2014-10-21 21:43:59 -04:00
Kevin Brown
3d1dc36711 Added support for placeholders
Placeholder support has been implemented as a separate module, so
any selection container should be able to be decorated and get
instant placeholder support. It hooks into the updating method of
selections, and determines when to display the placeholder based
on the options that are being updated.

It works in the same way as the old placeholders. If no options
are selected and being displayed, like in the case of a multiple
select, then the placeholder will always be shown.  If one option
is being displayed, and the id of the placeholder matches the id
of the selected element, then the placeholder will be shown.  This
is similar to the functionality that was present in Select2 2.x,
where the placeholder could be passed in as an object that would
be compared to the selection.

This still requires that, for single selects, the first element
must match the placeholder id.  Because the default placeholder id
is a blank string, this will maintain backwards compatibility with
past versions where the first option should be blank.  This can
still be overridden to point at a different id, keeping support
for systems where the placeholder doesn't use a blank value.

**Note:** This does not hide the blank option for single selects,
but that will still be maintained for backwards compatibility
within the results module.  It will not depend on a placeholder
being present, but instead will hide any options with blank text.
2014-10-21 21:43:59 -04:00
Kevin Brown
6375e2ee09 Working on searching results 2014-10-21 21:43:59 -04:00
Kevin Brown
ac7e7dae24 Added example for disabled results 2014-10-21 21:43:59 -04:00
Kevin Brown
acd469c658 Added optgroup support 2014-10-21 21:43:58 -04:00
Kevin Brown
5a17226ba6 Minify assets 2014-10-21 21:43:57 -04:00
Kevin Brown
14d3d99868 Basic multiple select implementation 2014-10-21 21:43:57 -04:00
Kevin Brown
792133ce5c Added Utils.Decorate and tests
This adds decorator support in a very basic way, but enough that
it doesn't take a lot of effort to get it implemented.

This also starts work on splitting things out for theming.
2014-10-21 21:43:56 -04:00
Kevin Brown
2ca14517bb Add classes to results options 2014-10-21 21:43:56 -04:00
Kevin Brown
01c3dc5886 Basic dropdown is in place 2014-10-21 21:43:56 -04:00
Kevin Brown
ae57cf6460 More work on rendering
Switched all of the divs to spans, as the container should not be
a block by default.
2014-10-21 21:43:56 -04:00
Kevin Brown
06e195b025 Work on the AMD scaffolding
This will make it far easier to ensure that components are in their
own modules as well as make it possible to have custom builds of
Select2.
2014-10-21 21:43:56 -04:00