Open
Bug 448582
Opened 16 years ago
Updated 2 years ago
Listitems with type="checkbox" doesn't work if .checked is set too early
Categories
(Core :: XUL, defect)
Tracking
()
NEW
People
(Reporter: bugz, Unassigned)
Details
Attachments
(2 files)
604 bytes,
text/plain
|
Details | |
690 bytes,
patch
|
neil
:
feedback-
|
Details | Diff | Splinter Review |
Listitem with checkbox can't be checked or unchecked if .checked property was set before widget was properly initialized. Situation is worsened by on first display initialization, which can quite late for items not in visible region (they are initialied when they are scrolled into view for first time). Attached example show this bug, first item doesn't have checked set so it work correctly, next items can't be checked because they have checked set.
Reporter | ||
Comment 1•16 years ago
|
||
There is a bit ugly fix for this bug. By setting .checked value before xbl widget initializes, we set "checked" slot in main object, all further changes to it just replaces this slot instead calling proper setter deeper in proto chain. This patch uses trickery to restore correct state. Simmilar change at xbl handling level will be even better (for one it will unbroke all widgets, this is not only limited to listitem), but i guess its no go because of potential regressions.
Assignee: nobody → bugz
Status: NEW → ASSIGNED
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
Comment 2•13 years ago
|
||
For future sufferers of this bug, a simple workaround is to use: aListItem.setAttribute("checked", true/false); as opposed to aListItem.checked = true/false;
Comment on attachment 331778 [details]
Example of broken behaviour
Remote XUL seems to not work anymore.
Attachment #331778 -
Attachment mime type: application/vnd.mozilla.xul+xml → text/plain
Comment on attachment 331781 [details] [diff] [review] v1 What's up with this patch? Forgot setting a request?
Attachment #331781 -
Flags: feedback?(bzbarsky)
Comment 5•12 years ago
|
||
Comment on attachment 331781 [details] [diff] [review] v1 Over to someone who might know something about this code. But offhand, that looks horrible... ;)
Attachment #331781 -
Flags: feedback?(bzbarsky) → feedback?(neil)
Comment 6•12 years ago
|
||
Comment on attachment 331781 [details] [diff] [review] v1 Personally I think this is wontfix, but at the very least you would want to use this.hasOwnProperty("checked") rather than saving and restoring the prototype.
Attachment #331781 -
Flags: feedback?(neil) → feedback-
Pawel, Mike, can you continue with the patch according to this info?
Comment 8•2 years ago
|
||
The bug assignee is inactive on Bugzilla, so the assignee is being reset.
Assignee: bugz → nobody
Status: ASSIGNED → NEW
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•