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
Cannot make toolbar appear on empty document (immediately after gaining focus) #28
Conversation
Codecov Report
@@ Coverage Diff @@
## master #28 +/- ##
==========================================
- Coverage 44.31% 44.29% -0.02%
==========================================
Files 30 30
Lines 4044 4041 -3
==========================================
- Hits 1792 1790 -2
+ Misses 2252 2251 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
bb874b8
to
6e347a5
Compare
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!
Just a question: Why did you re-add removed TODOs? @amantoux |
Did I? last commit removes them I beleive |
@Amir-P NB: We need to review the whole Editor renderer - widget in order to stick to Flutter latest Editable - EditableText arch; particularly with regards to focus management and user interactions |
@@ -608,7 +608,8 @@ class RenderEditor extends RenderEditableContainerBox | |||
// as well. | |||
if (selectionChanged || | |||
(cause == SelectionChangedCause.longPress || | |||
cause == SelectionChangedCause.keyboard)) { |
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.
I think it's better to extract this into an extension method on SelectionChangedCause
. WDYT? @amantoux
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.
@Amir-P what do you mean?
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.
Something like this:
Extension on SelectionChangedCause {
bool get shouldSendEvent => this == SelectionChangedCause.longPress || ...
}
WDYT? @amantoux
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.
Ok, I'm not sure it will be needed though it the future
Done; PTAL @Amir-P
Fixes #29
Before fix (go to menu once document is open, emulates opening an empty document and setting focus)
Before.fix.mov
After fix
After.fix.mov