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

Text entry widget backspace deletes two characters on Android #2774

Open
xxxserxxx opened this issue Feb 13, 2022 · 4 comments
Open

Text entry widget backspace deletes two characters on Android #2774

xxxserxxx opened this issue Feb 13, 2022 · 4 comments
Labels
unverified A bug that has been reported but not verified

Comments

@xxxserxxx
Copy link

Possibly related issues: #1941, #165

Describe the bug:

On Android, pressing backspace in an editable text entry widget deletes two characters.

To Reproduce:

  1. Clone this github repository
  2. Package for Android (fyne package -os android)
  3. Push to an android device, install, and run
  4. Select the text entry widget at the top of the screen
  5. Enter some text (e.g., "abcdefg")
  6. Press the keyboard's backspace (⌫) key

Two characters will be deleted. This happens from wherever in the string the cursor is, e.g. the end or the middle.

Example code:

Sample code is in a github repository. It is, essentially, a text entry widget with a list widget below. The text entry widget has an OnSubmitted lambda that prepends the text to the list. The behavior happens without the OnSubmitted closure as well.

Device (please complete the following information):

  • OS: Android
  • Version: Samsung One UI; Android 12. Built-in Samsung soft keyboard.
  • Go version: 1.17.7
  • Fyne version: v2.1.2
@xxxserxxx xxxserxxx added the unverified A bug that has been reported but not verified label Feb 13, 2022
@andydotxyz
Copy link
Member

andydotxyz commented Feb 13, 2022

Can you please check the version of the fyne command line tool? If you have been upgrading the library in your code it is important to re-run go install fyne-io/fyne/v2/cmd/fyne@latest (or specify a version) so that the tool matches the code version.

You can confirm with fyne version and also fyne env may have some clues.

@xxxserxxx
Copy link
Author

Yes, of course. Fyne versionS:

$ grep fyne.io go.mod go.sum && echo "######" && fyne version && echo "######" && fyne env
go.mod:require fyne.io/fyne/v2 v2.1.2
go.sum:fyne.io/fyne/v2 v2.1.2 h1:avp9CvLAUdvE7fDMtH1tVKyjxEWHWcpow6aI6L7Kvvw=
go.sum:fyne.io/fyne/v2 v2.1.2/go.mod h1:p+E/Dh+wPW8JwR2DVcsZ9iXgR9ZKde80+Y+40Is54AQ=
######
fyne cli version: v2.1.2
######
## Go module info
cli_version="v2.1.2"
go_mod="true"
go_path="false"
imported="true"
path="/home/ser/tmp/fyne.2"
version="v2.1.2"

## Go version info
version="go1.17.7 linux/amd64"

## Go environment info
CGO_ENABLED="1"
GO111MODULE=""
GOARCH="amd64"
GOOS="linux"

## OS info
architecture="x86_64"
home_url="https://archlinux.org/"
kernel="Linux 5.16.8-arch1-1 #1 SMP PREEMPT Tue, 08 Feb 2022 21:21:08 +0000"
name="Arch Linux"

I made sure the CLI was up to date, ran the above command, re-packaged & updated the APK, and confirmed that the issue persists. In the test repository, I removed the closure function for brevity, since it didn't affect the behavior.

@xxxserxxx
Copy link
Author

xxxserxxx commented Mar 31, 2022

Update

Now confirmed also on Fyne v2.1.4 on:

  1. On a Pixel 5 (phone, stock Google Android)
  2. On a Samsung Galaxy Z Flip (phone, stock Samsung Android)
  3. On a Pixel C with BT keyboard (tablet running Lineage OS, a de-Googled Android fork)
  4. Android SDK emulator with android-32 (VM)

The Pixel C + BT keyboard behaves differently: every key press is duplicated, not just backspace. On the other environments, it's only backspace.

## Go module info
cli_version="v2.1.4"
go_mod="true"
go_path="false"
imported="true"
path="/home/ser/workspace/forage.d/forage"
version="v2.1.4"

## Go version info
version="go1.18 linux/amd64"

## Go environment info
CGO_ENABLED="1"
GO111MODULE=""
GOARCH="amd64"
GOOS="linux"

## OS info
architecture="x86_64"
home_url="https://archlinux.org/"
kernel="Linux 5.16.16-arch1-1 #1 SMP PREEMPT Mon, 21 Mar 2022 22:59:40 +0000"
name="Arch Linux"

@xxxserxxx
Copy link
Author

Curiously, this issue does not happen with the FlorisBoard Beta keyboard on my Samsung. Maybe it has something to do with the stock keyboards' text prediction? In any case, it still happens with the stock Samsung kb, and Fyne apps are the only place I've observed this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unverified A bug that has been reported but not verified
Projects
None yet
Development

No branches or pull requests

2 participants