-
Notifications
You must be signed in to change notification settings - Fork 230
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
[SuperEditor][Android] Show expanded handles when expanding the selection (Resolves #1937) #2014
Conversation
@angelosilvestre please post a video of the solution |
if (widget.selection.value != null && | ||
widget.selection.value?.isCollapsed == false && | ||
_controlsController!.shouldShowCollapsedHandle.value == true) { | ||
// The selection is expanded, but the collapsed handle is visible. This can happen when the |
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.
This reads like a bandaid - it says "here's a state that shouldn't happen, but does happen, so we'll correct it here".
Why is the wrong thing happening to begin with? Why is this the right place to correct it?
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.
Well, usually we show/hide the handles in the touch handlers of the interactor. A double tap shows the expanded handle, a single tap shows the collapsed handle, etc...
In this case the selection is changed elsewhere. So I think we should be changing the handle visibility when the selection changes.
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.
In this case the selection is changed elsewhere
Where is it being changed?
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.
@angelosilvestre did you see this question?
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.
@matthew-carroll I haven't noticed this, sorry.
The "Select All" button issues a ChangeSelectionRequest
, this isn't initiated by one of our widgets.
expanded.webm |
@angelosilvestre this PR now has some conflicts after another PR was merged. Also, can you take a look at the failing website deployment actions? They seem to be failing in a number of PRs but I'm not sure why. |
35b8412
to
92e60bc
Compare
@matthew-carroll I resolved the conflicts. The website build failure seems to be due to the |
return; | ||
} | ||
|
||
if (selection.isCollapsed == true && |
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.
Is there a reason that you're doing == true
and == false
for a boolean value?
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.
Previously we were handling a nullable value and I forgot to update it. I updated it now.
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
[SuperEditor][Android] Show expanded handles when expanding the selection. Resolves #1937
When the selection changes from collapsed to expanded, the collapsed handle is visible at the beginning of the selection, and the expanded handles aren't visible:
collapsed.webm
This PR fixes the issue by changing the visibility of the handles when needed.