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

Problem with text entry in Entry widget (cursor stays put - Backspace or Delete causes panic) #1096

Closed
RoyTeymant opened this issue Jun 10, 2020 · 3 comments
Labels
blocker Items that would block a forthcoming release bug Something isn't working
Milestone

Comments

@RoyTeymant
Copy link

Describe the bug:

I raised a question about this on the slack channel on 2020-06-10. After I tab to an Entry field that has been refreshed with i2.Text = "" and i2.Refresh() and start typing the cursor stays at the beginning of the input field. If, after typing a few characters (with the cursor still at the beginning of the input field), I press Backspace or Delete the program panics.

The problem behaviour can be seen in the attached screen grab (first pass is OK, second isn't).

At Andrew's suggestion I tried i2.SetText("") instead of i2.Text = "" and that works OK, or has so far.

2020-06-10 20-25-33.zip

Device (please complete the following information):

  • OS: Windows 8.1
  • Version:
  • Go version: go1.14.2 windows/amd64
  • Fyne version: 1.3
@andydotxyz
Copy link
Member

andydotxyz commented Jun 10, 2020

Thanks, I can replicate this locally with some tweaked fyne_demo code, stack looks like:

panic: runtime error: slice bounds out of range [:9] with capacity 4

goroutine 34 [running]:
fyne.io/fyne/widget.(*textProvider).deleteFromTo(0xc00024a2d0, 0x8, 0x9, 0x9, 0xc000e1bf58, 0x4008677)
	/Users/andy/Code/Go/src/fyne.io/fyne/widget/text.go:165 +0x23a
fyne.io/fyne/widget.(*Entry).TypedKey(0xc0000b67e0, 0xc0000bfe50)
	/Users/andy/Code/Go/src/fyne.io/fyne/widget/entry.go:442 +0xae6
fyne.io/fyne/internal/driver/glfw.(*window).keyPressed.func7()
	/Users/andy/Code/Go/src/fyne.io/fyne/internal/driver/glfw/window.go:955 +0x38
fyne.io/fyne/internal/driver/glfw.(*window).runEventQueue(0xc0000a8000)
	/Users/andy/Code/Go/src/fyne.io/fyne/internal/driver/glfw/window.go:1071 +0x7a
created by fyne.io/fyne/internal/driver/glfw.(*gLDriver).createWindow.func1
	/Users/andy/Code/Go/src/fyne.io/fyne/internal/driver/glfw/window.go:1095 +0x103
exit status 2

Is this the same as you saw (except the index number perhaps)?

@andydotxyz andydotxyz added the bug Something isn't working label Jun 10, 2020
@andydotxyz andydotxyz added this to the 1.3.x milestone Jun 10, 2020
@andydotxyz andydotxyz added the blocker Items that would block a forthcoming release label Jun 10, 2020
@RoyTeymant
Copy link
Author

Yes the error looks the same:

`panic: runtime error: slice bounds out of range [:11] with capacity 8

goroutine 19 [running]:
fyne.io/fyne/widget.(*textProvider).deleteFromTo(0xc000261b90, 0xa, 0xb, 0xa, 0xc00018ff58, 0x4072ce)
C:/Users/Roy/Go/src/fyne.io/fyne/widget/text.go:165 +0x241
fyne.io/fyne/widget.(*Entry).TypedKey(0xeaf480, 0xc0022e69e0)
C:/Users/Roy/Go/src/fyne.io/fyne/widget/entry.go:452 +0x9dc
fyne.io/fyne/internal/driver/glfw.(*window).keyPressed.func7()
C:/Users/Roy/Go/src/fyne.io/fyne/internal/driver/glfw/window.go:955 +0x3f
fyne.io/fyne/internal/driver/glfw.(*window).runEventQueue(0xc0000a8000)
C:/Users/Roy/Go/src/fyne.io/fyne/internal/driver/glfw/window.go:1071 +0x81
created by fyne.io/fyne/internal/driver/glfw.(*gLDriver).createWindow.func1
C:/Users/Roy/Go/src/fyne.io/fyne/internal/driver/glfw/window.go:1095 +0x10a
`

@andydotxyz
Copy link
Member

On develop for testing :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Items that would block a forthcoming release bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants