ui-select icon indicating copy to clipboard operation
ui-select copied to clipboard

Array.indexOf not supported in IE8

Open drozv opened this issue 12 years ago • 4 comments

Array.indexOf is used in several places which is not supported in IE8 and the project says that IE8 is supported.. this causes problems.

ctrl.setActiveItem for example.

drozv avatar Jul 23 '14 15:07 drozv

You need es5-shim, examples/demo.html already does that:

  <!--
    IE8 support, see AngularJS Internet Explorer Compatibility http://docs.angularjs.org/guide/ie
    For Firefox 3.6, you will also need to include jQuery and ECMAScript 5 shim
  -->
  <!--[if lt IE 9]>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.js"></script>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.2.0/es5-shim.js"></script>
    <script>
      document.createElement('ui-select');
      document.createElement('ui-select-match');
      document.createElement('ui-select-choices');
    </script>
  <![endif]-->

tkrotoff avatar Jul 23 '14 15:07 tkrotoff

Actually it seems that Array.indexOf is used only in 3 places and is probably not needed at all. The $index from the ng-repeat can be passed into the functions ctrl.setActiveItem and ctrl.isActive this way the item lists don't need to be actively searched for the index which happens many times per second for ctrl.isActive... I'm still digging deeper and I've found another issue on ie8 where the ng-mouseenter is sent for each item in the ng-repeat (item list), this causes ie8 to crap out on medium sized lists (60+) elements.

drozv avatar Jul 23 '14 16:07 drozv

Drozv, didn't see this - just opened #158 earlier

sambomartin avatar Aug 12 '14 13:08 sambomartin

Closing as guidance for IE8 is given in Wiki which says to include shim.

user378230 avatar Mar 20 '16 20:03 user378230