select1 keyboard navigation problems

RESOLVED FIXED

Status

Core Graveyard
XForms
RESOLVED FIXED
11 years ago
a year ago

People

(Reporter: aaronr, Assigned: aaronr)

Tracking

({fixed1.8.0.12, fixed1.8.1.4})

Trunk
x86
All
fixed1.8.0.12, fixed1.8.1.4

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(5 attachments)

127 bytes, text/xml
Details
2.78 KB, application/xhtml+xml
Details
3.39 KB, application/xhtml+xml
Details
3.54 KB, patch
surkov
: review+
Doron Rosenberg (IBM)
: review+
Details | Diff | Splinter Review
2.62 KB, patch
Details | Diff | Splinter Review
(Assignee)

Description

11 years ago
It is possible to get xf:select1 in such a state that it will not allow keydown or keyup navigation.  It seems to be an issue with replacing/rebuilding the instance the select1 binds to when it contains a xf:itemset.
(Assignee)

Comment 1

11 years ago
Created attachment 245160 [details]
external instance data

external instance data for the testcase
(Assignee)

Comment 2

11 years ago
Created attachment 245161 [details]
testcase
(Assignee)

Comment 3

11 years ago
The following appears in the error console:

Error: parent has no properties
Source File: chrome://xforms/content/select1.xml
Line: 354
(Assignee)

Comment 4

11 years ago
The problem is with the rebuild.  At the point of xforms-ready, select1 has a selected item which lives in the itemset.  The rebuild is causing the xf:itemset to remove its old content and repopulate with new xf:items.  And when it does this, then select1 is refreshed, but since the currently selected item (the one itemset removed) already has the correct value, we think we are saving ourselves a lot of work and we just return.  So this._selected will always be the old, removed item.  Any function that then tries to use the DOM based of this selected item will run into troubles since the item no longer lives in the DOM.  That is why we are getting the "parent has no properties" error.

The way to fix this is probably to clear the select/select1's cache of selected value(s) when xf:itemset is refreshed.  That should be safe because anytime this happens, we should force the select/select1 to refresh again.  I'll work on this fix.
Assignee: xforms → aaronr
(Assignee)

Comment 5

11 years ago
Created attachment 255965 [details]
testcase2

Getting some bad behavior from select, too.
(Assignee)

Comment 6

11 years ago
(In reply to comment #5)
> Created an attachment (id=255965) [details]
> testcase2
> 
> Getting some bad behavior from select, too.
> 

unrelated problem, but I'll fix it in this patch, too, since the fix is minor.  Problem is that the new removeNativeElm() method had some bugs in it.
(Assignee)

Comment 7

11 years ago
Created attachment 256123 [details] [diff] [review]
patch

I fixed this using the mutation handler that alex put in select1.xml.  If we detect that an item is getting removed, we check to see if it is the currently selected item.  If it is, then we'll null it out so that it isn't remembered when select1 refreshes the next time.
Attachment #256123 - Flags: review?(surkov.alexander)
(Assignee)

Updated

11 years ago
Attachment #256123 - Flags: review?(doronr)

Updated

11 years ago
Attachment #256123 - Flags: review?(surkov.alexander) → review+

Updated

11 years ago
Attachment #256123 - Flags: review?(doronr) → review+
(Assignee)

Comment 8

11 years ago
checked into trunk
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch
(Assignee)

Comment 9

10 years ago
crap, looks like this patch won't work on FF2.  I never see the DOMNodeRemoved handler firing.  Maybe this was fixed by bug 367164, but that never made it into the branches.
(Assignee)

Comment 10

10 years ago
Created attachment 261189 [details] [diff] [review]
patch for 1.8 and 1.8.0

this patch works around the limitation of DOMNodeRemoved not working on the branch.  This approach won't be needed once we do the performance re-write where itemset insertions and deletions of items will be handled much cleaner.
(Assignee)

Comment 11

10 years ago
checked into 1.8 branch on 2007-04-12
checked into 1.8.0 branch on 2007-04-16
Keywords: fixed1.8.0.12, fixed1.8.1.4
Whiteboard: xf-to-branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.