Skip to content
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

Add iOS tap in empty space to show toolbar, Android long-press in empty space to show toolbar. (Resolves #1472) #1476

Merged
merged 3 commits into from
Oct 4, 2023

Conversation

matthew-carroll
Copy link
Contributor

Add iOS tap in empty space to show toolbar, Android long-press in empty space to show toolbar. (Resolves #1472)

@matthew-carroll
Copy link
Contributor Author

CC @miguelcmedeiros

Copy link
Collaborator

@angelosilvestre angelosilvestre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a couple comments.

final didTapOnExistingSelection = exactTapTextPosition != null &&
_selectionBeforeTap != null &&
(_selectionBeforeTap!.isCollapsed
? exactTapTextPosition == _selectionBeforeTap!.extent
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we compare just the offset to consider selections with different affinities equal?

// Toggle the toolbar display when the user taps on the collapsed caret,
// or on top of an existing selection.
final didCaretStayInSamePlace = _selectionBeforeTap != null &&
_selectionBeforeTap == widget.textController.selection &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question here about selection affinity.

@matthew-carroll matthew-carroll merged commit 24aef3e into main Oct 4, 2023
10 of 11 checks passed
@matthew-carroll matthew-carroll deleted the 1472_supertextfield-show-toolbar-when-empty branch October 4, 2023 17:59
matthew-carroll added a commit that referenced this pull request Oct 4, 2023
matthew-carroll added a commit that referenced this pull request Oct 4, 2023
raulmabe-labhouse added a commit to LabhouseMobile/super_editor that referenced this pull request Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SuperTextField][iOS/Android] Not possible to show the text selection toolbar when the field is empty
2 participants