Open
Bug 381982
Opened 17 years ago
Updated 2 years ago
Inconsistent behaviour of optgroups
Categories
(Core :: Layout: Form Controls, defect)
Core
Layout: Form Controls
Tracking
()
NEW
People
(Reporter: Morten, Unassigned)
References
(Blocks 2 open bugs)
Details
(Keywords: testcase)
Attachments
(3 files)
686 bytes,
text/html
|
Details | |
3.70 KB,
text/html
|
Details | |
2.40 KB,
patch
|
bzbarsky
:
review-
bzbarsky
:
superreview-
|
Details | Diff | Splinter Review |
Using Seamonkey 1.1.1, the first optgroup label of a select selects the first option when clicked, while the second optgroup label does nothing when clicked. XHTML testcase attached.
Updated•17 years ago
|
Severity: enhancement → normal
Keywords: testcase
OS: Windows XP → All
Hardware: PC → All
Version: unspecified → Trunk
Comment 1•17 years ago
|
||
Morten, what behavior exists in a trunk build? http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/
Reporter | ||
Comment 2•17 years ago
|
||
Installed and tested, same behavior as described above found.
![]() |
||
Comment 3•17 years ago
|
||
The difference is that when trying to find the clicked-on option, the code does: // If the event coordinate is above the first option frame, then target the // first option frame So if you click the first optgroup, that targets the first option, since you're clicking above it. However, if you click on the second optgroup, we end up with no option targeted. You'd get similar behavior if you had an empty optgroup at the end: we'd select the _last_ option, due to: // If the event coordinate is below the last option frame, then target the // last option frame I suppose we could explicitly make targeting an optgroup target its first option. Is that the behavior we want?
Reporter | ||
Comment 4•17 years ago
|
||
I'd say it might make sense to have the optgroup select all it's items when clicked.. but not so if just dragged across or shift-selected across..
![]() |
||
Comment 5•17 years ago
|
||
And if it's not a <select multiple> ?
Reporter | ||
Comment 6•17 years ago
|
||
If we make it select all its members when multiple, the only sensible thing to do in a single select case, is not to select anything at all.. in my opinion.
![]() |
||
Comment 7•17 years ago
|
||
Frankly, I think the "not select anything at all" behavior is what we want in general. It's simple, consistent, and has no surprises for the user.
Comment 8•17 years ago
|
||
Comment 9•17 years ago
|
||
(In reply to comment #7) > Frankly, I think the "not select anything at all" behavior is what we want in > general. It's simple, consistent, and has no surprises for the user. I agree. That is also somewhat compatible with what IE7 and Safari does. Opera 9.20 seems more like our current behaviour - it selects what is nearest. There is one case where I think we should do something when clicking on a group label; when selecting a range of options in a multi-select list (ie. SHIFT+click) we should add all the non-disabled options up to that point - this is also what IE7, Safari and Opera does. It's also consistent with what happens when you SHIFT+click on a disabled option. Other than that I don't think we should do any selection, just focus the list, as if we clicked on some other non- option area of the list (padding/border/scrollbar/disabled option).
Comment 10•17 years ago
|
||
I'll file a separate bug on the SHIFT+click thing mentioned above.
Attachment #276289 -
Flags: superreview?(bzbarsky)
Attachment #276289 -
Flags: review?(bzbarsky)
Comment 11•17 years ago
|
||
Note on compat: IE7 - clicking on a group label in a multi-select list deselects all items, this seems like a bug since it doesn't do anything in a single-select list. Opera 9.20 - using SHIFT+click you can select disabled options in a multi-select list, clearly a bug.
Updated•17 years ago
|
Assignee: nobody → mats.palmgren
![]() |
||
Comment 12•17 years ago
|
||
Comment on attachment 276289 [details] [diff] [review] Patch rev. 1 This would regress bug 290428.
Attachment #276289 -
Flags: superreview?(bzbarsky)
Attachment #276289 -
Flags: superreview-
Attachment #276289 -
Flags: review?(bzbarsky)
Attachment #276289 -
Flags: review-
![]() |
||
Comment 13•17 years ago
|
||
I'd prefer it if we added explicit checks for clicking on an optgroup, for what it' worth.
![]() |
||
Comment 14•17 years ago
|
||
And even then, we should watch out for bug 290428 with optgroups.
Comment 15•2 years ago
|
||
The bug assignee is inactive on Bugzilla, so the assignee is being reset.
Assignee: MatsPalmgren_bugz → nobody
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•