Skip to content

UI-router issue with IE8 #452

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

Closed
baad opened this issue Sep 20, 2013 · 7 comments
Closed

UI-router issue with IE8 #452

baad opened this issue Sep 20, 2013 · 7 comments

Comments

@baad
Copy link

baad commented Sep 20, 2013

UI-router does not work with IE 8 when I have a button markup like the one below

<input type="submit" class="btn btn-primary" value="Next" data-ui-sref="Users.Create.StepX" />

When I click on the button nothing happens. It works in chrome ,IE9 and IE10 but not in IE8.

It seems the issue is with e.which in below code in angular-ui-router.js.

IE8 doesnot provide any value to e.which and it defaults to 0 and is causing issue.

 element.bind("click", function(e) {
        if ((e.which == 1) && !e.ctrlKey && !e.metaKey && !e.shiftKey) {
          $state.go(ref.state, params, { relative: base });
          scope.$apply();
          e.preventDefault();
        }
      });
@wesleycho
Copy link
Contributor

This is not quite fixed - on IE8, with var button = e.which || e.button, it turns out that button == 0 is true for button elements.

@plopinou
Copy link

I have the same problem on IE8, so I just removed the test on (e.which == 1) to have it working correctly for the time being.
A better correction would be to feature detect IE8 with something like :
if ((e.which == 1 || !angular.element("<div> </div>")[0].firstChild) && ...) (from jquery source code)
or simply remove the test with e.which which may not be really that usefull tbh.

I'm in favor of not always adding code for old IE versions, but I still often need to do IE8 compatible websites for customers that are still on XP, so I do require this kind of support for a little longer :)

@scottywakefield
Copy link

I agree with plopinou - the less fortunate of us still have to support IE7 and IE8.

@Voles
Copy link
Contributor

Voles commented Nov 30, 2013

This is fixed by #617.

@scottywakefield
Copy link

@Voles - much appreciated.

@quantuminformation
Copy link

XP will likely be around for longer with big corps paying for patches.

@Voles
Copy link
Contributor

Voles commented Feb 19, 2014

Microsoft will end support for Windows XP on April 8th.
Let's hope those big corps then finally move on!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants