machineboy2045 / angular-selectize

angular-selectize
MIT License
201 stars 115 forks source link

Selectize does not seem to work in IE11 with older angular versions #177

Open mhording opened 6 years ago

mhording commented 6 years ago

Upgrading angular is not an option here.

The setup includes "angular": "1.5.8", "selectize": "^0.12.4", "angular-selectize2": "1.2.3" "jquery": "2.1.4",

The directive seems to be working in almost every other browser with this setup, including Edge, but fails in IE11.

The error I am getting in IE11 is

Error: Invalid argument. at setup (http://wfcontent-dev.local/wf/libs.js?ver=3.12.0-alpha:67555:13494) at w (http://wfcontent-dev.local/wf/libs.js?ver=3.12.0-alpha:67555:11805) at Anonymous function (http://wfcontent-dev.local/wf/libs.js?ver=3.12.0-alpha:67556:8093) at each (http://wfcontent-dev.local/wf/shims.js?ver=3.12.0-alpha:374:6) at jQuery.prototype.each (http://wfcontent-dev.local/wf/shims.js?ver=3.12.0-alpha:139:3) at a.fn.selectize (http://wfcontent-dev.local/wf/libs.js?ver=3.12.0-alpha:67556:7803) at link (http://wfcontent-dev.local/wf/libs.js?ver=3.12.0-alpha:67683:3) at Anonymous function (http://wfcontent-dev.local/wf/libs.js?ver=3.12.0-alpha:14677:11) at Anonymous function (http://wfcontent-dev.local/wf/libs.js?ver=3.12.0-alpha:23359:34) at invokeLinkFn (http://wfcontent-dev.local/wf/libs.js?ver=3.12.0-alpha:23365:9) <selectize class="ng-pristine ng-untouched ng-valid ng-isolate-scope" ng-model="$ctrl.question.value" ng-disabled="!$ctrl.editable" ng-change="$ctrl.c

If i try the plunk however, it seems to be working just fine.

vldolot commented 6 years ago

I had this same issue in IE11 and the resolution I did was to replace the

<selectize
    options="..."
    config="..."
    ...
>
  ...
</selectize>

element with:

<input
    selectize
    type="text"
    options="..."
    config="..."
    ... 
/>
mhording commented 6 years ago

It seems the bug was caused by a version conflict and that someone silently updatet some css in the package. Setting the selectize package to explicitly use "selectize": "0.12.4", rather than "selectize": "^0.12.4",

apparantly fixed the problem. No need to change any code.

adlh commented 6 years ago

@mhording thanks! Pinning the version to 0.12.4 fixed the problem for me too.