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

android: pressing enter in multiline entry hides keyboard #971

Closed
pymq opened this issue May 11, 2020 · 9 comments
Closed

android: pressing enter in multiline entry hides keyboard #971

pymq opened this issue May 11, 2020 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@pymq
Copy link
Contributor

pymq commented May 11, 2020

Describe the bug:

Pressing enter on the virtual keyboard when typing in entry hides it. It should hide keyboard only when MultiLine is false.

To Reproduce:

Steps to reproduce the behaviour:

  1. Open Fyne demo
  2. Open Form tab in Widgets tab
  3. Type something in Message, press enter
  4. Keyboard is hidden, but focus is still on entry

Device (please complete the following information):

  • OS: Android
  • Version: 8.0
  • Go version: 1.14.2
  • Fyne version: develop 04d654b
@andydotxyz
Copy link
Member

What is the label on the keyboard button you are tapping?

@pymq
Copy link
Contributor Author

pymq commented May 11, 2020

Ah I see. It's "OK" instead of "Enter" icon. From #972 video you can see the Samsung keyboard example. I just tried with another keyboard - it's the same: there is no "Enter" button, line breaks on pressing to "OK" and keyboard hides. And now we coming to question about supporting different types of keyboard - only digits, multiline etc

@andydotxyz
Copy link
Member

multiple keyboards will be a later addition as we need to add support to the toolkit for that.
Your description is logical, and we have a decision to make.
At this time we don't have support for different types of keyboard so we need to pick either the newline capable one (that would fix this issue) for all entries, or leave it as it is.
I suspect that moving to an "enter" button is the right thing to do and will resolve this issue. It will also bring more modern phones in line with the older ones that don't support the same configuration of "action" button.

@andydotxyz andydotxyz self-assigned this May 11, 2020
@andydotxyz andydotxyz added the bug Something isn't working label May 11, 2020
@andydotxyz
Copy link
Member

Fixed for testing on develop

@pymq
Copy link
Contributor Author

pymq commented May 11, 2020

Cool, thanks!

It would be also great to hide keyboard on enter if it's !MultiLine entry.
I can send a CL if it helps.

@andydotxyz
Copy link
Member

Unfortunately the keyboard currently does not know about the details of the entry. That’s where the bigger fix comes in.
But if you can find a way to do it sooner that would be a bonus

@pymq
Copy link
Contributor Author

pymq commented May 11, 2020

I think it could be done simply in https://github.com/fyne-io/fyne/blob/develop/widget/entry.go#L400
by something like

if device, ok := fyne.CurrentDevice().(mobile.Device); ok {
	device.HideVirtualKeyboard()
}

Focus will still be at entry, but at least keyboard will hide.

@andydotxyz
Copy link
Member

That's a clever workaround. Not entirely certain if we should but I will look into it :)
(hesitance is because keyboard handling is in the driver currently...)

@andydotxyz
Copy link
Member

Let's come back top this if your #975 does not resolve the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants