Fix 'change' event propagation #828

Open
wants to merge 2 commits into
from

Conversation

Projects
None yet
1 participant
@marcandre

I'm relying on $(document).on('change', 'input.foo') for form validation and it is not triggered by dateInput.js because of two bugs:

  1. I don't know why, but the event triggering the date change is reused. The target is still set to the day I clicked on, so the event won't be caught properly. My patch disregards the event passed, but if you want you could instead delete e.target before firing the event.

I'm no expert in JS, but I find the idea of reusing events (for different types and after they have been fired!) really ugly. Here it's reused after beforeChange. What if bubbling is turned off? What if, I don't know, anything was modified?

  1. Clearing the date doesn't fire anything.

@marcandre marcandre referenced this pull request Jul 31, 2012

Closed

Fix bubbling #825

@marcandre

This comment has been minimized.

Show comment Hide comment
@marcandre

marcandre Oct 4, 2012

Ping?

Ping?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment