Ticket #11638 (closed bug: invalid)
PreventDefault in keypress event cancels change event after multiple calls.
| Reported by: | admin@… | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | None |
| Component: | event | Version: | 1.7.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Returning false or using preventDefault from a keypress handler for a textbox, will prevent a change event from triggering for the same textbox after multiple calls.
The steps to reproduce this bug are in the following jsFiddle: http://jsfiddle.net/portablesheep/hYmue/9/
You'll notice this example is using keypress to detect enter, and subsequently click a button. This example was chosen as it's a scenario I ran into at work.
Change History
comment:1 Changed 13 months ago by rwaldron
- Priority changed from undecided to low
- Resolution set to invalid
- Status changed from new to closed
- Component changed from unfiled to event
comment:2 Changed 13 months ago by anonymous
I see what you're saying. I was under the impression that by pressing enter in this case with a different value than the original, that the change event would occur. I didn't think about the blur being the trigger, and blur not occurring in this scenario.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

I followed your instructions to the letter and I'm not sure how you didn't notice that your own documented instructions provide the answer you need:
... Nothing has changed since the change event at #1, it is still "123"