-
Notifications
You must be signed in to change notification settings - Fork 93
Angularjs compatible #49
base: master
Are you sure you want to change the base?
Conversation
This version is compatible with angularjs select list generated with ng-options. The code added could maybe be write in a nicer way, feel free to do so.
@PsyStorm25 thank you very much for your contribution. unfortunately i still have issues using your patched file. using the angular directive ng-repeat together with ng-model to create select options an empty select option is always displayed. |
Hello webermax, I think this is an expected behavior from angularjs and it is not dependent on dropdown.js
Once an option is selected and so ng-model set, the empty option should disappear. If you are talking about a different issue, please provide more details (code example) and I could see how to adapt the file. |
Here is an example showing the default behavior of angularjs with drop down list: |
ok, i see. the problem occurs when relying on "some black magic casted by a evil wizard" and the select element is loaded within an angular template. |
Added code to fix an issue on the selected item style when setting the selected value back to 'undefined'. Changed the code ordering the item. Now it exactly match the 'option' order from native select control.
I have added a new version fixing some minor issues. |
webermax, Well for me it is working (based on the information you shared). Here you can find an example containing 2 drop down lists: The first one is a ‘select’ generated from markup in the page. The second drop down list is the one that could interest you I think. Hope this helps. |
Fixing a bug with "empty" option.
Big update on the files. It is now compatible with optgroup element and can be combined with angularjs also. I also changed the use of DOMNodeInserted and DOMNodeRemoved with the more recent MutationObserver because there was a problem I noticed only with Firefox when the select input was loaded from angularjs SPA page (single page application).
Big update on the file. I also changed the use of DOMNodeInserted and DOMNodeRemoved with the more recent MutationObserver because there was a problem I noticed only with Firefox when the select input was loaded from angularjs SPA page (single page application). |
Fixed a bug on IE when there was an empty value in the dropdown.
I fixed a bug on IE when there was an empty value in the dropdown. |
This version is compatible with angularjs select list generated with ng-options.
The code added could maybe be write in a nicer way, feel free to do so.