Closed
Bug 16924
Opened 26 years ago
Closed 26 years ago
Cannot set the focus on a non-visible input element into a scrollable tree
Categories
(Core :: XUL, defect, P2)
Tracking
()
VERIFIED
FIXED
M14
People
(Reporter: bugzilla, Assigned: bugzilla)
References
Details
Attachments
(1 file)
2.16 KB,
text/plain
|
Details |
It's another variation of the focus bug 15002. But this case is different. The problem occurs with message compose
addressing widget. But for simplify the problem, I will describe it with a sample xul file attached to this bug
report:
I have a tree with 4 rows defined, each of them has an input field. The defined tree height allow only 3 rows to be
visible. Each
time I press return into one of the input element, the next input field will get the focus. That works fine until the
next row isn't
visible, in this case input.focus() failed with the error -2147467262 (component does not have requested interface).
How to reproduce it:
------------------
1) Install attached files addressWidget.xul and addressWidget.js into your HD at the same location
2) open addressWidget.xul into the browser (Mozilla)
3) type something into the first input field and then press <return>
--> second input field get the focus
4) type something into the second input field and then press <return>
--> third input field get the focus
5) type something into the third input field and then press <return>
--> JS exception throw, the third input field keep the focus!
Expected result: the tree should scroll up one row and give the focus to the fourth input field which is now visible
Assignee | ||
Comment 1•26 years ago
|
||
oops, don't need addressWidget.js, the .xul is enough...
Assignee | ||
Comment 2•26 years ago
|
||
Updated•26 years ago
|
Assignee: trudelle → saari
Updated•26 years ago
|
Priority: P3 → P2
Target Milestone: M11
Comment 3•26 years ago
|
||
Have you tried this using a table instead? Would that be a viable workaround?
reassigning to saari as p2 for m11. should this be a dogfood candidate?
Assignee | ||
Comment 4•26 years ago
|
||
I will try to convert the addressingWidget to use table. The main reason we use tree instead table is that we will
need to be able to specify the height of the tree in term of rows. As this feature isn't implemented yet, table should
be fine...
Comment 5•26 years ago
|
||
mass-moving most m11 bugs to m12
Assignee | ||
Comment 6•26 years ago
|
||
We cannot use table as you cannot control the height of a table. All rows are
visible.
Comment 7•26 years ago
|
||
I think this is due to the tree widget's lazy building of rows... you're trying
to focus a row that isn't built yet. Hyatt, does that sound right?
Assignee | ||
Comment 8•26 years ago
|
||
do we have a work around (else than using JS timer do delay the focus call)?
Comment 9•26 years ago
|
||
Oh God.
This sucks.
This really sucks.
Do you REALLY have to use a tree widget? You're pushing it in ways that I just
can't deal with.
Comment 10•26 years ago
|
||
You could use a table instead of a tree and constrain its height either by
making a tbody with an overflow auto and a height constraint or by making a
constrained iframe and just throwing content into that.
Comment 11•26 years ago
|
||
Mass-moving non-PDT+ bugs to M13
Updated•26 years ago
|
Assignee: saari → hyatt
Comment 12•26 years ago
|
||
David, I'm tossing you this bug. I guess maybe alec should get it now?
Updated•26 years ago
|
Status: NEW → ASSIGNED
Target Milestone: M13 → M15
Comment 13•26 years ago
|
||
Ok, I believe alec has given you the capability to scroll to a certain row. You
can scroll first, and then call focus. Tossing back to you.
This is true, right alec?
Assignee: hyatt → ducarroz
Status: ASSIGNED → NEW
Assignee | ||
Comment 14•26 years ago
|
||
Change it for M14. Forcing the row to scroll before setting its value may fix several bugs.
Status: NEW → ASSIGNED
Target Milestone: M15 → M14
Comment 15•26 years ago
|
||
yep, you can call tree.ensureContentIsVisible() (you can use any element in the
tree, and it will bring that element's row into view) and then focus it....
though I don't know exactly how this works with reflows, etc...
ensureContentIsVisible will not actually take effect until the next reflow,
which means it might not happen until after the your JS has finished
executing...
I think hyatt can answer this one with my explanation. Hyatt, basically it
behaves just like the user dragged the thumb the exact minimum amount in order
to bring that row into view, so it does that whole smart-scrolling thing where
it destroys only the minimum number of frames to get there, and leaves a content
chain for the next reflow.
Comment 16•26 years ago
|
||
btw, Jean-Francois - this is something you need to call (assuming it works of
course) from the compose window, not something the tree can do. stop by if you
need a better explanation
Assignee | ||
Comment 17•26 years ago
|
||
I have a fix. That also fix bug 21280
Whiteboard: Fixed reviewed, waiting for tree to open
Assignee | ||
Comment 18•26 years ago
|
||
Fixed and checked in
Whiteboard: Fixed reviewed, waiting for tree to open
Assignee | ||
Comment 19•26 years ago
|
||
oops, change resolution to fixed
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Comment 20•26 years ago
|
||
ducarroz, does your attached testcase work for you? For me, with the 2000013111 build on WinNT I can't even get focus to the
first textfield much less type into it or any of the others. AM I being blocked by another new bug or is the testcase not valid?
Comment 21•26 years ago
|
||
The testcase doesn't work and nothing I've seen from the addressing widget in mail compose makes me think this is fixed. I
suspect another/other bugs may be blocking me but without any more information I am forced to REOPEN this bug.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 22•26 years ago
|
||
I don't know if my test case works but the way to test it is to enter 4
recipients by using only the enter key, the cursor should be alway into the new
field after pressing enter.
But because of bug 26344, you cannot verify this yet.
Status: REOPENED → RESOLVED
Closed: 26 years ago → 26 years ago
Depends on: 26344
Resolution: --- → FIXED
Summary: Cannot set the focus on an no-visible input element into a scrollable tree → Cannot set the focus on a non-visible input element into a scrollable tree
You need to log in
before you can comment on or make changes to this bug.
Description
•