-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Textbox
focusable and trigger redraw in response to request_layout
#537
Conversation
// TODO - We assume that a relayout will trigger a repaint | ||
if self.root_state().needs_paint | ||
|| self.root_state().needs_accessibility | ||
|| self.root_state().needs_layout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick comment on this: right now layout is implicitly triggered as part of the paint/accessibility pass: you want to paint something, therefore you lay it out first.
A side-effect of this is that previous to this change, calling request_layout wouldn't call a layout pass until some widget somewhere requested a paint pass. (Even though the layout pass automatically requests a paint pass.)
Once pass spec is complete, layout will run with all the other passes whenever anything happens, and this line will be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear to me why this isn't marked as fixing #301
We also need to remove all of the other workarounds to that bug.
The other orthogonal change looks fine.
Anything left besides the ones I just patched? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These code changes look good to me.
Is there an example where this can be tested? I don't think any other widget can yet be focused, and TextBox
eats Tab
We could probably change the title to include a mention of the new layout behaviour. E.g. to:
Make `Textbox` focusable and redraw in response to `request_layout`
IIRC Textbox doesn't eat Tab. When I was testing this I just made an example with two textboxes. I guess I could push a similar one. |
The two textbox case isn't working for me... |
d763708
to
6d9035d
Compare
Textbox
focusable and trigger redraw in response to request_layout
I've pushed a few fixes for crashes I saw, and I pushed an example with two textboxes. Tab switching works with that example for me. If it doesn't for you, that's something we'll have to investigate more in-depth. |
(Pinging Philipp since IIRC Daniel is on vacation.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
(I'm also vacationing, but sitting in a train right now...)
What behaviour do you expect me to be seeing when I press Tab in two_textboxes? I cannot see a cursor after pressing it at the moment, and typing doesn't work either. |
For me the cursor doesn't appear in the second box, but typing does work. It weird that it doesn't for you. We might need to do a live debugging session. |
99dc016
to
362bb58
Compare
There's some overlap between this branch and the work I just did on my textbox-accesskit-focus branch (before I discovered this branch). You may want to look at what I did on that branch, particularly with the new |
Will do. |
Tweak accessibility code. Fix portal bug.
80a84e2
to
921fb23
Compare
Is this supposed to work yet when pressing Tab to focus the first (or only) textbox if nothing has focus yet? That doesn't work for me when running the to_do_mvc example from the latest commit on this branch. |
No, I fixed that in #593. |
Fixes #301.