Skip to content

Update title and classnames (when option enabled) from select on update #2319

New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

isochronous
Copy link

This Fixes #2232 and Fixes #2311.
I simply extracted the logic that determines which classnames to apply to the container into a separate method, did the same for the logic that copies the title attribute, then replaced the original logic with calls to those two methods and added the same calls to the results_build method in the appropriate places so that classes and the title will be updated from the select on update.

I also significantly reorganized the spec files to make them more granular. I originally had the whole virtual DOM being reconstructed and torn down before and after each test, but ran into some issues in prototype when using that approach that I was unable to figure out. Since none of the current tests (or the tests I added) actually conflict with each other, I just organized the tests so that the virtual DOM and the chosen instance are only created once before any test and then destroyed after all tests.

Both prototype and jQuery versions were updated, and all tests are passing.

Modified chosen so that if inherit_select_classes is set to true, then
classes will be copied from the select to the chosen container every
time "chosen:updated" is triggered.
Also added logic to ALWAYS copy the title attribute from the select to
the container whenever "chosen:updated" is triggered.
Updated both jQuery and prototype versions
Heavily refactored unit tests for better granularity
All jQuery unit tests are passing, but two prototype unit tests are
failing for an unknown reason (exception being thrown from a prototype
method, it's not just a failed assertion).
…on update

Modified chosen so that if inherit_select_classes is set to true, then
classes will be copied from the select to the chosen container every
time "chosen:updated" is triggered.

Add logic to ALWAYS copy the title attribute from the select to
the container whenever "chosen:updated" is triggered.

Updated both jQuery and prototype versions
Heavily refactored unit tests for better granularity
All jQuery unit tests are passing, but two prototype unit tests are
failing for an unknown reason (exception being thrown from a prototype
method, it's not just a failed assertion).
Cleaned up some duplicate logic that I'd left in the prototype version
Significantly reorganized both spec files
Got all unit tests working for both versions
Remove the x86-mingw32 entry from the PLATFORMS list
@thirtysixwind
Copy link

hello

@isochronous
Copy link
Author

Hi there

@isochronous
Copy link
Author

In case anyone wants these versions of chosen before this pull request is accepted (assuming it is), you can find both the jQuery and prototype versions here: https://gist.github.com/isochronous/541fa49aa34f7f5b20a3

@isochronous
Copy link
Author

Is anyone paying attention to these pull requests?

…on update

Modified chosen so that if inherit_select_classes is set to true, then
classes will be copied from the select to the chosen container every
time "chosen:updated" is triggered.

Add logic to ALWAYS copy the title attribute from the select to
the container whenever "chosen:updated" is triggered.

Updated both jQuery and prototype versions
Heavily refactored unit tests for better granularity
All jQuery unit tests are passing, but two prototype unit tests are
failing for an unknown reason (exception being thrown from a prototype
method, it's not just a failed assertion).
Cleaned up some duplicate logic that I'd left in the prototype version
Significantly reorganized both spec files
Got all unit tests working for both versions
Remove the x86-mingw32 entry from the PLATFORMS list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants