Closed Bug 517007 Opened 15 years ago Closed 3 years ago

explicitOriginalTarget contains inconsistent element and tagName

Categories

(Core :: DOM: Events, defect, P5)

x86
Windows XP
defect

Tracking

()

RESOLVED DUPLICATE of bug 662335

People

(Reporter: rob.apodaca, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)

In a form with an input and button present, if entering some text into the input element and pressing return, firefox triggers a click event on the first button (if any) in the form. That event object's explicitOriginalTarget property contains the button element instead of the input element. If no text is entered into the input and the enter key is pressed, the event object's explicitOriginalTarget property contains the input element.

Reproducible: Always

Steps to Reproduce:
For the given markup and js:
<script type="text/javascript">
  function clicker(evt){
   alert(evt.explicitOriginalTarget.tagName)
  }
</script>
<form action="/" method="post">
  <input type="text" />
  <button onClick="clicker(event)">Button</button>
</form>

--Case: With some text
1. Place focus on the text input.
2. Enter a string: "foo"
3. Press enter

--Case: With no text
1. Place focus on the text input.
2. Press enter
Actual Results:  
In the case of "With some text": the tagName is "BUTTON"
In the case of "With no text": the tagName is "INPUT"

Expected Results:  
In the case of "With some text": the tagName should be "INPUT"
In the case of "With no text": the tagName should be "INPUT"
Component: General → DOM: Events
Product: Firefox → Core
QA Contact: general → events
We should remove explicitOriginalTarget.
Blocks: 517930
Depends on: 662335
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
No longer blocks: 517930
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
No longer depends on: 662335
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.