Closed
Bug 267627
Opened 21 years ago
Closed 21 years ago
select event isn't fired when selection of listbox is changed
Categories
(Core :: XUL, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: surkov, Assigned: csthomas)
References
Details
Attachments
(2 files)
594 bytes,
application/vnd.mozilla.xul+xml
|
Details | |
2.18 KB,
patch
|
bryner
:
review+
bryner
:
superreview+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040616
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040616
I have listbox with seltype='multiple'. I select some items. Select event isn't
fired when I click on some selected item. In other words when I reduce selection
of listbox by clicking on selected item then event isn't fired.
I guess there is problem in click event handler of listitem binding.
var didSuppressSelect = false;
var i = 0;
while (i < selectedItems.length) {
if (selectedItems[i] != this) {
if (!didSuppressSelect) {
parentNode._suppressOnSelect = true;
didSuppressSelect = true;
}
parentNode.removeItemFromSelection(selectedItems[i]);
}
else
i++;
}
When _suppressOnSelect=true then select event isn't fired.
Need to switch _suppressOnSelect and fire event after all calls of methods
removeItemFromSelection().
Reproducible: Always
Steps to Reproduce:
Comment 1•21 years ago
|
||
> Select event isn't fired when I click on some selected item.
Select event applies only for input type text and password and when
selecting/highlighting text.
http://www.w3.org/TR/html4/interact/scripts.html#adef-onselect
> In other words when I reduce selection
> of listbox by clicking on selected item then event isn't fired.
>
> I guess there is problem in click event handler of listitem binding.
Click and change events are also different events.
http://www.w3.org/TR/html4/interact/scripts.html#adef-onchange
Can you attach a *reduced* testcase showing the problem?
What is a Simplified Test Case, and How Do I Make One?
http://www.mozilla.org/newlayout/bugathon.html#testcase
Reporter | ||
Comment 2•21 years ago
|
||
>Select event applies only for input type text and password and when
>selecting/highlighting text.
I know what DOM Events Level2 specification says about select event. But I seem
XUL has extended event model. See xulplanet
http://www.xulplanet.com/references/elemref/ref_EventHandlers.html#attr_onselect.
See realization of listitem binding (it fires select event!):
chrome://global/content/bindings/listbox.xml#listitem.
>Click and change events are also different events
I didn't told about change event I told about select event. Also I told that
listitem binding fires select event on click event.
Reporter | ||
Comment 3•21 years ago
|
||
Reporter | ||
Comment 4•21 years ago
|
||
We can follow DOM Level2 Events specification and can remove firing of select
event from listbox element. In this case developers cannot know about selection
changes immediately (they will have chnage event only).
But we can serve extention of w3c specification for xul elements and we can add
one line in click hangler of listitem element.
if (didSuppressSelect)
parentNode._suppressOnSelect = false;
parentNode._fireOnSelect();//we can add this line only to fire select event
Reporter | ||
Comment 5•21 years ago
|
||
Need to write:
if (didSuppressSelect){
parentNode._suppressOnSelect = false;
parentNode._fireOnSelect();
}
Updated•21 years ago
|
Keywords: helpwanted
Assignee | ||
Updated•21 years ago
|
Assignee | ||
Comment 6•21 years ago
|
||
See comment #5. This makes the testcase work as the reporter expects.
Assignee | ||
Updated•21 years ago
|
Attachment #166293 -
Flags: superreview?(roc)
Attachment #166293 -
Flags: review?(dbaron)
Comment on attachment 166293 [details] [diff] [review]
patch
Brian might have more of a clue about this than either dbaron or I.
Attachment #166293 -
Flags: superreview?(roc)
Attachment #166293 -
Flags: superreview?(bryner)
Attachment #166293 -
Flags: review?(dbaron)
Attachment #166293 -
Flags: review?(bryner)
Assignee | ||
Updated•21 years ago
|
Whiteboard: active → active, r?
Updated•21 years ago
|
Attachment #166293 -
Flags: superreview?(bryner)
Attachment #166293 -
Flags: superreview+
Attachment #166293 -
Flags: review?(bryner)
Attachment #166293 -
Flags: review+
Assignee | ||
Comment 8•21 years ago
|
||
checked in by timeless
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
QA Contact: stephend
Resolution: --- → FIXED
Whiteboard: active, r?
Comment 9•21 years ago
|
||
https://bugzilla.mozilla.org/attachment.cgi?id=164689&action=view is working
fine for me now with build 2004-12-07-06 on Windows XP.
Tried all types of selection, including contiguous and non-contiguous.
Verified FIXED
Status: RESOLVED → VERIFIED
Comment 10•21 years ago
|
||
*** Bug 279096 has been marked as a duplicate of this bug. ***
Comment 11•20 years ago
|
||
*** Bug 135172 has been marked as a duplicate of this bug. ***
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: stephen.donner → xptoolkit.widgets
You need to log in
before you can comment on or make changes to this bug.
Description
•