Search code examples
angularjsinternet-explorer-10angularjs-ng-repeatmouseentermousedown

IE10 - ng-repeat - mousedown - mouseenter


What i'm trying to do is to click on an element then mouse over the others items and change their class, it's working on chrome but not on IE. When I look at the elements we can see that on IE it "blocks" the elem to the first selected, only the first change color.

You can check this out by showing the IE console

              <input
          class="inputOrder input-number–noSpinners" type="number" min="0" max="1"
              ng-class="{inputConfirmed:isInputConfirmed(elem),inputSelected:elem.selected}"
              ng-disabled="elem.disabled"
              ng-mouseenter="evaluateMouseEvent(elem);"
              ng-mousedown="selectElem(elem,dayRange2);"
              ng-model="elem.value">

          </div>

Plunkr : http://plnkr.co/edit/1ATifw29ctpEjYDqoMe7?p=preview

On chrome, when I click on the first item then go over the others elements (while still clicking) on the console we see:

1 2 3

On IE, we see :

1 1 1

Solution

  • Adding a prevenDefault() resolved the problem.

    ng-mousedown="selectElem(elem,dayRange2,$event);"

    and in the JS : event.preventDefault();