Closed Bug 190399 Opened 22 years ago Closed 6 years ago

Add oninput, onfocus, onblur event handlers to menulist widget

Categories

(Core :: XUL, defect)

x86
Windows 98
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: WeirdAl, Assigned: WeirdAl)

References

()

Details

Attachments

(3 files, 2 obsolete files)

The <xul:menulist/> element does not currently support adding onfocus or onblur
event handlers.  Editable menulists do not support the oninput event handler.

They do support event listeners; the current implementation for editable
menulists uses an event listener to pass focus and blur onto the anonymous
<html:input/> node.

I have gotten the oninput event handler working for editable menulists; I am
filing this bug to track the issue, and should have a patch tomorrow.
Attached patch patch, v1 (obsolete) — Splinter Review
I'd appreciate anyone who could independently test this patch.

I've had a couple strange effects.  This patch repeatedly causes a window focus
problem on the last testcase (probably related to one of the bugs bug 140346
blocks).  Also, the testcase, with patch engaged, apparently doesn't always
want to let you focus on the editable menulist without focusing on something
else first.  No idea why.

I'm also wondering about the correct order of focus and blur events which this
bug should implement.  Should menulist take focus before or after the input
field, or vice versa?  Likewise, which element should lose focus first?
cc'ing jst and jkeiser for events clarification.
jkeiser dislikes (with good reason) firing two focus events, and thinks there's
a more fundamental process going on to look into.  So I'm splitting off the
oninput patch, which is unrelated, and promoting that one while obsoleting the
onfocus and onblur patch suggestion.
Attachment #112527 - Attachment is obsolete: true
Attachment #112550 - Flags: superreview?(jaggernaut)
Attachment #112550 - Flags: review?(neil)
No longer blocks: 112775
Perhaps xbl:inherits="onfocus,onblur,..." will work à la textbox.

Also, I don't know what the input problem is, can you provide a test case?
Doh, why don't I read the bug before commenting :-)

Is there a reason why the attributes should be kept up-to-date?

Interestingly the "label" setter changes the property but not the attribtues...
Comment on attachment 112526 [details]
Testcase (XUL document)

Please remember to include the global stylesheet next time...
Comment on attachment 112550 [details] [diff] [review]
patch, v2 (for oninput only)

This is wrong anyway because you only set the "value" attribute, everywhere
else also sets "label".
Attachment #112550 - Flags: review?(neil) → review-
Current behaviour:
1. Selecting a menuitem updates both attributes
2. Setting .value updates both attributes
3. Setting .label updates neither attribute
4. oninput updates neither attribute
I'm still not convinced that 1 & 2 are correct and 3 & 4 are wrong :-/
Attachment #112870 - Attachment is obsolete: true
Comment on attachment 112550 [details] [diff] [review]
patch, v2 (for oninput only)

Clearing sr? flag on patch which has r-.
Attachment #112550 - Flags: superreview?(jag)
Component: XP Toolkit/Widgets: Menus → XUL
QA Contact: shrir → xptoolkit.widgets
This bug was filed sixteen years ago - if it hasn't happened by now, with XUL on the way out, it's never going to happen.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: