-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Fixes #3505 Calling focus on hidden elements breaks page on ie8 #3516
Conversation
$.mobile.focusPage() fails in jquery.mobile.transition.js in outInTransitionHandler( name, reverse, $to, I also wrapped .focus call to try try/catch block to prevent similar errors in the feature. |
I think this just transplanted the issue that jQuery had up into our code. The problem with swallowing the exception is that it's the same as not calling focus at all in IE. If we remove the focus call altogether then it doesn't much matter but if the focus call is important then we need to move the focus call to the point at which the element is visible. Can you comment on how important that focus is? (We focus the title on page load I believe) |
If you're asking if it's important to set focus on the active page, yes it is. Otherwise, the focus could be stuck on a non-active page which is bad for both accessibility and keyboard navigation. |
@johnbender |
So the conclusion here then that jQuery Mobile is sacrificing IE8 support in favour of 'accessibility and keyboard navigation' on other browsers? |
Hi @davidosullivan. No, it does not, we still working on this bug. |
cool, thats good news ;) Was just a bit confused by the fact the issue is marked as closed... I don't really understand Github- I'll have a read of the Help section... |
@davidosullivan This is a pull request, not an issue so we decided to close the PR because the suggested code approach didn't satisfy our requirements for both IE8 and accessibility support. @sgrebnov will create a new PR with a revised solution that will cover both requirements. |
ahh ok I get it now ;) Thanks for taking the time to explain ;) |
Did you submit another PR, or did you intend to update this one with the changes you mentioned. I don't see either. Either way thanks for the change of tack! |
HI @johnbender, |
Hey all I was just going through commits to figure out why transitions aren't feeling as good as when they landed. This change appears to be part of it... Unfortunately, I think this change ended up clobbering remembered scroll distances when you return to a page. It'll also introduce a jump sometimes after pageshow, especially if iOS console is open (which isn't an actual issue really, but it clued me in that something was off on the timing). In the transitions rewrite earlier this year, I moved this call from where it is again now, into the transitions handler to ensure that focus was called on a page before it's shown or scrolled, otherwise, focus will jump the page to the top again after the scroll. It looks like this change undid that 51b0677 Of course, there appears to be an actual issue here to fix in IE8, but I'm pretty sure we should find another way of fixing it. that doesn't require moving the focus call back out of the transition handler again. I'll take a look, and make a new issue. |
Okay, some more info on this one... IE8 only throws this error on the initial page load, and it's because this class: .ui-mobile-rendering > * { visibility: hidden; } ...is still present when the page is transitioning in. I realized this when I noticed that the error was occurring because while page was indeed display:block, it was set to "visibility: hidden", meaning this isn't really a transitions bug, but rather one with init. I'll dig into getting that class removed earlier now. |
Reopening to fix this another way... |
No description provided.