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

Entry field Enter does not always move to next field #5724

Closed
david-maw opened this issue Mar 31, 2022 · 10 comments · Fixed by #11386
Closed

Entry field Enter does not always move to next field #5724

david-maw opened this issue Mar 31, 2022 · 10 comments · Fixed by #11386
Labels
area-controls-entry Entry fixed-in-7.0.58 Look for this fix in 7.0.58! fixed-in-7.0.100 fixed-in-7.0.101 fixed-in-8.0.0-preview.1.7762 Look for this fix in 8.0.0-preview.1.7762! platform/android 🤖 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@david-maw
Copy link

david-maw commented Mar 31, 2022

Additional Notes

  • Good Summary of behavior: Entry field Enter does not always move to next field #5724 (comment)
  • XF implemented the forward motion manually. On Android the forward behavior happens automatically so I'm curious why this behavior doesn't work automatically. Ideally, we can just make it work opposed to having to implement our own focus search code.
    • It looks like Next fails to work because for OnEditorAction we set e.Handled to true for everything so Android doesn't fall back to its default behavior ever

Description

On a screen with multiple entry fields the treatment of the enter key is inconsistent. What I've seen so far:

On Android, if ReturnType is set to Next the on screen key appearance changes to a 'Tab' icon and clicking it does nothing. If ReturnType="Done" the icon changes to an "Enter" icon and clicking it calls the Completed action. In neither case does it advance focus to the next field.

On Windows pressing the enter key calls OnCompleted whether ReturnType is set to Done or Next and the the focus switches to the next field if ReturnType is set to Next (and not Done) all of which seems correct.

Xamarin Forms acts like Windows (above) except that pressing enter in a field where ReturnType="Done" causes the field to be unfocused rather than focusing on the next field as Next would.

Steps to Reproduce

  1. Unzip the project in Simple-Entry.zip
  2. Compile and run the program on Android
  3. Select the first field
  4. Click on the on screen keyboard button to advance to the next field
  5. Note that nothing happens (no call of OnCompleted, no change in focus)

Here's what you should see (the blue virtual key is the one you should click on):

Simple-Entry

Version with bug

Preview 14 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android 11, Windows 10

Did you find any workaround?

No

Relevant log output

No response

@david-maw david-maw added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels Mar 31, 2022
@kristinx0211 kristinx0211 added the s/verified Verified / Reproducible Issue ready for Engineering Triage label Mar 31, 2022
@kristinx0211
Copy link

verified repro on Android 12 using above project.

@jfversluis jfversluis added legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor area-controls-entry Entry and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Apr 1, 2022
@jsuarezruiz jsuarezruiz self-assigned this Apr 1, 2022
@Redth Redth added this to the 6.0.300-servicing milestone Apr 5, 2022
@Michal-MK
Copy link

Michal-MK commented Jun 8, 2022

Just to add, the ReturnCommand is not executed reagdless the ReturnType used. (Android only, on Windows it does call the command.)

@Forestbrook
Copy link

Forestbrook commented Jun 23, 2022

Return key treatment found on 6.0.400-preview.22301.10:

ANDROID:

  • ReturnType=Next: Tab-icon shown on return key. Nothing happens when the key is pressed, ReturnCommand and Completed event are NOT executed.
  • ReturnType=Done: Check-icon shown on return key. When return key is pressed, Entry field has still focus, but ReturnCommand and Completed event ARE executed.

iOS

  • ReturnType=Next: 'next' shown on return key. When return key is pressed, Entry field unfocused, ReturnCommand and Completed event ARE executed.
  • ReturnType=Done: 'done' shown on return key. When return key is pressed, Entry field unfocused, ReturnCommand and Completed event ARE executed.

Windows (tested with external keyboard only)

  • ReturnType=Next: When return key is pressed, focus to next Entry field, ReturnCommand and Completed event ARE executed.
  • ReturnType=Done: When return key is pressed, Entry field has still focus, but ReturnCommand and Completed event ARE executed.

Preferred behavior:

  • First of all, behavior should be consistent: the same on all platforms.
  • ReturnType=Next: moving focus to next Entry field on all platforms would be nice, but it should be possible to overide this (I guess this is possible by setting the focus programmatically to another field in the Completed event - not tested).
  • ReturnType=Done: unfocus the Entry field on all platforms and remove on-screen keyboard.

@david-maw
Copy link
Author

Thanks @Forestbrook, very thorough. I'd just add that multi-line entry fields (text blocks) present an issue for "Next' behavior because it's often more convenient for the end user if they perform a new line function rather than switching to the next field. This does leave the problem of how to signal a switch to the next field using a soft keyboard, on Android at least, see issue #5730. I suspect in most cases it's easiest to use a gesture to do that, but one could imagine coding triple enter or something of that sort to mean the same thing.

@Forestbrook
Copy link

Thanks @Forestbrook, very thorough. I'd just add that multi-line entry fields (text blocks) present an issue for "Next' behavior because it's often more convenient for the end user if they perform a new line function rather than switching to the next field. This does leave the problem of how to signal a switch to the next field using a soft keyboard, on Android at least, see issue #5730. I suspect in most cases it's easiest to use a gesture to do that, but one could imagine coding triple enter or something of that sort to mean the same thing.

You can use the Editor control if you need multiple lines.

@david-maw
Copy link
Author

@Forestbrook wrote "You can use the Editor control if you need multiple lines"

Sorry, I should have been clearer, I agree not only can you use an Editor for multi-line input, you should (issue #5730 does) so you make a good point that multi-line input is a non-issue for Entry fields. An Editor Control has the problem of how to signal end of entry as opposed to end of line, but it should not be an issue for an Entry field since they are the same thing.

@Kalyxt

This comment was marked as off-topic.

@AbstractionsAs
Copy link

I'm struggling with this as well

@Redth Redth modified the milestones: 6.0-servicing, Backlog Aug 30, 2022
@ghost
Copy link

ghost commented Aug 30, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@dfcowan

This comment was marked as off-topic.

rmarinho pushed a commit that referenced this issue Nov 30, 2022
…#10858 Fixes #8302

* Don't set editor action to handled

* - Add tests

* - remove for tizen

Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
@ghost ghost locked as resolved and limited conversation to collaborators Dec 17, 2022
@samhouts samhouts added the fixed-in-7.0.58 Look for this fix in 7.0.58! label Feb 16, 2023
@samhouts samhouts modified the milestones: Backlog, .NET 7 + Servicing Feb 16, 2023
@samhouts samhouts added the fixed-in-8.0.0-preview.1.7762 Look for this fix in 8.0.0-preview.1.7762! label Feb 22, 2023
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-entry Entry fixed-in-7.0.58 Look for this fix in 7.0.58! fixed-in-7.0.100 fixed-in-7.0.101 fixed-in-8.0.0-preview.1.7762 Look for this fix in 8.0.0-preview.1.7762! platform/android 🤖 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet