Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Prepare for easier test automation: Make Select2 search field accessible by script #456

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

jesperronn commented Oct 1, 2012

...tically

Example:
$(obj).select2("search") => reference to the input field, select2 shows as input element. This is very
convenient for automatic testing purposes

Jesper Rønn-Jensen Added API change to select2, so you can get to the search field progr…
…amatically

Example:
$(obj).select2("search")  => reference to the input field, select2 shows as input element. This is very
                             convenient for automatic testing purposes
fdc9c12
Contributor

jesperronn commented Oct 1, 2012

I put this change in, because I want to make Select2 easier testable. This commit creates a "search" hook to expose this.search (already defined in codebase).

$("#element_select2_enhanced").select2("search")

Contributor

ivaynberg commented Feb 10, 2013

when select2 builds its containers it copies css classes from the source element. it also copies the id by setting it to s2id_

once you have the container you can find the search. in single select you will have to get the dropdown opened first.

using select2("search") is dangerous because select2 may be in an incompatible state to have the field accessed.

@ivaynberg ivaynberg closed this Feb 10, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment