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

Don't show text selector when no text is ready #15770

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

emmauss
Copy link
Contributor

@emmauss emmauss commented May 20, 2024

What does the pull request do?

When there's no text in a textbox, tapping it will not show the selection handles.

What is the current behavior?

Text selectors always show even when there's no text to select.

What is the updated/expected behavior with this PR?

How was the solution implemented (if it's not obvious)?

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes #15694

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0048537-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@robloo
Copy link
Contributor

robloo commented May 20, 2024

On Android with Samsung S23 (not using Avalonia) here is the functionality.

  1. First tap into empty textbox the cursor appears.
  2. Second tap into an empty textbox the cursor AND selection handle appears and the Paste, etc. Context menu opens.

I think you are oversimplifying this a bit and the selection handle is useful user feedback in some cases. At least it makes clear where the cursor is.

@emmauss
Copy link
Contributor Author

emmauss commented May 20, 2024

On Android with Samsung S23 (not using Avalonia) here is the functionality.

1. First tap into empty textbox the cursor appears.

2. Second tap into an empty textbox the cursor AND selection handle appears and the Paste, etc. Context menu opens.

I think you are oversimplifying this a bit and the selection handle is useful user feedback in some cases. At least it makes clear where the cursor is.

I'm only able to show the handles on an empty textbox when you long press. This both shows the context menu and the handle. Tapping doesn't. Imho, there isn't a purpose of the handle when the textbox is empty, as no selection can occur, and context menu will still show with long press

@robloo
Copy link
Contributor

robloo commented May 20, 2024

In Samsung OneUI this is what I see:

Single tap:

Tap once, wait and tap again:

Edit: And a purpose of this might be strong user feedback in the UI where text input will occur. This is easier to see than a blinking cursor in some cases. I also expect that the selection handles and context menu are always shown together.

We probably need to know what is done in iOS as well.

@emmauss
Copy link
Contributor Author

emmauss commented May 20, 2024

Yeah. We need to check how iOS handles it

@maxkatz6
Copy link
Member

maxkatz6 commented May 21, 2024

First tap into empty textbox the cursor appears.
Second tap into an empty textbox the cursor AND selection handle appears and the Paste, etc. Context menu opens.

On iOS:

  1. First tap shows the cursor
  2. Second tap shows the context menu, but not the selection handle
  3. Selection handle only appears if field is not empty, and user double tapped on the text (long press only moves the cursor).

Some apps (mostly, messengers) actually select all the text on second tap as well. But it seems to be a custom behavior.

@emmauss
Copy link
Contributor Author

emmauss commented May 21, 2024

Flutter seems to use the android behavior(long press to show handle and menu) when using the material theme, and no showing when using cupertino(ios)

@robloo
Copy link
Contributor

robloo commented May 21, 2024

Flutter matching the host OS behavior seems correct to me. That could definitely be debated though.

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.

Visibility of Text selection handles on empty TextBoxes on Android
4 participants