Closed Bug 392863 Opened 17 years ago Closed 6 years ago

event.preventDefault() on <select> should prevent dropdown from appearing

Categories

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

9 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1019630

People

(Reporter: kes-kes, Unassigned)

Details

(Keywords: testcase)

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6

When I subscribe to 'mousedown' event for <select> tag
and call 'event.preventDefault' I do not want list of options to be opened in some cases


Reproducible: Always

Steps to Reproduce:
<script type="text/javascript">

function handler(event) {
 event.preventDefault();
 }

</script>

<select onmouseover='handler'><option>aaa</optioin><option>bbb</option></select>
Actual Results:  
list of options of <select> tag are opened when I call preventDefault from event handler

Expected Results:  
list of options of <select> tag must not be opened when I call preventDefault from event handler

<script type="text/javascript">

function handler(event) {
 event.preventDefault();
 }

</script>

<select onmouseover='handler'><option>aaa</optioin><option>bbb</option></select>
Attached file Testcase (obsolete) —
Component: General → DOM: HTML
Product: Firefox → Core
QA Contact: general → general
Summary: Can not prevent Default action for <Select> tag → event.preventDefault() on <select> should prevent dropdown from appearing
Component: DOM: HTML → DOM: Core & HTML
Attached file correct testcase
I don't see how the first testcase would be able to work, but it seems to me this one should.
Attachment #277378 - Attachment is obsolete: true
Component: DOM: Core & HTML → DOM: Events
Keywords: testcase
QA Contact: general → events
Component: DOM: Events → Layout: Form Controls
QA Contact: events → layout.form-controls
Or perhaps event handling is better.
Component: Layout: Form Controls → Event Handling
QA Contact: layout.form-controls → events
Is this the same issue as Bug 291082?
Whiteboard: [dupeme?]
Re-reading makes me think this isn't a dupe of Bug 291082.

Confirmed the issue still exists in Mozilla/5.0 (Windows NT 5.1; rv:9.0a1) Gecko/20110903 Firefox/9.0a1 ID:20110903030832
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [dupeme?]
Version: unspecified → 9 Branch
Still exists.

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0
The bug is still here. 
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0
We got several bugs which all about preventDefault on key/mouse events don't stop the default action of a select element. The behavior was the same as other browsers at that time. Now looks like all browsers stop default behavior except Firefox. We probably should collect the behavior of all browsers and align the behavior for compatibility with other browsers. Let's keep Bug 1019630 open (to cover the cases of mouse and keyboard events) and close the others.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
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: