In the previous commit (02cca7b) support was added for multiple
selects to automatically focus when they were tabbed into. While
this did actually work, it caused a few bugs with the focus that
prevented users from tabbing out of the container, effectively
trapping keyboard users in Select2.
This makes a few major changes to how things work in Select2, but
should not break any backwards compatibility.
- The internal `focus` event is now proxied through a `focus`
method on the core object. This allows for two important things
1. The `focus` event will only be triggered if Select2 was in an
unfocused state.
2. Select2 now (unofficially) supports the `select2('focus')`
method again.
But that does mean that it is possible to trigger the `focus`
event now and not have it propagate throughout the widget. As
it would previously trigger multiple times, even when Select2
had not actually lost focus, this is considered a fix to a bug
instead of a breaking change.
- The internal `blur` event in selections is only triggered when
the focus is moved off of all elements within the selection. This
allows for better tracking of where the focus is within Select2,
but as a result of the asynchronous approach it does mean that the
`blur` event is not necessarily synchronous and may be more
difficult to trace.
- On multiple selects, the standard selection container is never
visually focused. Instead, the focus is always shifted over to
the search box when it is requested. The tab index of the selection
container is also always copied to the search box, so the search
will always be in the tab order instead of the selection container.
It's important to note that these changes to the tab order and how
the focus is shifted do not apply to multiple selects that do not
have a search box. Those changes also do not apply to single select
boxes, which will still have the same focus and tabbing behaviours
as they previously did.
Conflicts:
docs/examples.html
In the docs-improvements branch, the docs examples live in partials located in docs/_includes/examples.
The updated AJAX example code from https://github.com/select2/select2/pull/3357 – the conflicting addition to docs/examples.html – has been ported to the appropiate partial in docs/_includes/examples.data.html.
This adds the final box, which I've chosen to be for the browser
support (though that can be changed).
The last two boxes on the first row have also been swapped, partially
because the text sizes now match the second row, but also because
the AJAX support should be more prominent than the theme support.
This adds correct links to the linked text on the front page under
the features section. There is still one panel which needs to be
written, the last one that includes the AJAX text again, before it
can really be considered finished.
The wording around the Bootstrap theme was adjusted pending further
discussion about how that is going to be handled.
Replaced ArrayAdapter super constructor call with correct AjaxAdapter super constructor call. This will allow users to initialize an Ajax select with data.
Per bower/bower.json-spec#43 :
> Use source files with module exports and imports over pre-built distribution files.
Also, the example in that PR includes
/sass/motion.scss in and excludes
/dist/movement.css & /dist/movement.min.css
from its `main`.