这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@jagooding
Copy link
Contributor

As you stated the focus event does not bubble in Internet Explorer.

If you call .triggerHandler() on a focus event - the browser's default focus action would not be triggered, only the event handlers bound to the focus event.

This prevents IE's default behavior.

@jagooding
Copy link
Contributor Author

I just read your last comment, and realized I synced your commit right before I changed it to trigger handler, so I have no idea if it is an actual solution or not.

@jagooding
Copy link
Contributor Author

Okay, so I reverted your commit because I wanted to see if mine was even an appropriate solution, and it is, it still works. So if you want to double check, or use which ever solution you feel is best, that's cool.

@amsul I really appreciate you being responsive and working quickly to help resolve this.

@amsul
Copy link
Owner

amsul commented Jan 17, 2013

Oh, that's awesome! .triggerHandler never occurred to me. I'm going to give this a shot. Thanks :)

amsul added a commit that referenced this pull request Jan 17, 2013
fixed IE focus event propagation
@amsul amsul merged commit 550ed21 into amsul:dev Jan 17, 2013
@amsul
Copy link
Owner

amsul commented Jan 17, 2013

Hmm I get the feeling this is breaking the keyboard accessibility since the input doesn't actually receive the browser focus.

@jagooding
Copy link
Contributor Author

On IE 10 for Windows 8, I am able to tab into it, move around with the arrow keys, escape, delete, all that good stuff. Using the developer tools it appears to work in lesser versions of IE, however if that is that actual case, I'm not sure since I don't have the actual lesser binaries?

@amsul
Copy link
Owner

amsul commented Jan 18, 2013

Try doing this: Focus into the input, then click on the calendar. Not on any date - just an empty space so it doesn't close. And then try to use your keyboard for navigation.

@amsul
Copy link
Owner

amsul commented Jan 18, 2013

Or even changing the month recreates that issue..

It also seems to cause the tabindex flow to break.

@jagooding
Copy link
Contributor Author

Mmm yeah, gotcha. I can reproduce that. The keyboard events are bound to the input ELEMENT right?

@amsul
Copy link
Owner

amsul commented Jan 18, 2013

Yes, sort of. They're actually handled at the document level because there are keyboard events for the drop-downs and buttons as well. The keyboard events can be un-bound from the input - but I think the bigger issue becomes the tabindex flow since it gets reset to the body.

@jagooding
Copy link
Contributor Author

Yeah, I looked through the source a couple times, and I don't see any way to quickly fix it without introducing some kind of global var for tracking state or doing what would probably be considered a major code rewrite. I tried playing around with a couple things near line 168 ( the if ( !$HOLDER.find( event.target ).length && event.target != ELEMENT ) code) but everything I tried causes a stack overflow, which is NOT a good solution. I'll keep looking at it, but off the bat, my solution doesn't work if you have to ensure the ability to maintain keyboard input under all conditions. :/

@jagooding
Copy link
Contributor Author

The first thing that comes to mind is that when you click something, like next month for example, focus is being set to not what it was when you opened the calendar, which is what is disabling keyboard input, so in my mind, the solution is to kill the click event on anything that isn't overridden while the calendar is open. Not sure where that would go though. I'm reading through some doc's right now.

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

Successfully merging this pull request may close these issues.

2 participants