Closed Bug 434721 Opened 16 years ago Closed 14 years ago

onchange event is triggered incorrectly if input is removed and inserted again

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: tmunch, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14

If I from javascript remove a input-element with removeChild and immedialy insert the element the same place in the DOM-tree and set focus to the element again, the onchange event is fired. Even through nothing is changed in the input.

Reproducible: Always

Steps to Reproduce:
1.Look at the submitted example, the example is an input with a onchange event and     a script to remove the input and put it back in the DOM tree.
2.Click in the input field
3.Now the script to remove the input is triggered, and input is set back to the DOM-tree and focus is given to the input element.
Actual Results:  
The onchange event is fired for the input field, even through nothing is changed

Expected Results:  
No onchange event expected
Attached file Testcase #1
This document is used to describe the problem.
Seems to work correctly with Firefox 3.6 and current trunk (4.0).
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: