Closed
Description
Checklist
- I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
- This issue only relates to a single bug. I will open new issues for any other problems.
Describe the bug
Pretty much the title, fairly simple bug I think. The single line entry will discard any selected text on submit.
How to reproduce
With a single line entry:
- Type in "abc" and hit enter: you get "abc" ✔️
- Type in "abc" hit ctrl+a to select all and hit enter: you get "" 😢
- Type in "abc" select just the b and hit enter: you get "ac" 😢
Screenshots
No response
Example code
package main
import (
"fmt"
"image/color"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/canvas"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
)
func main() {
application := app.NewWithID("test-gui")
window := application.NewWindow("Test GUI")
monospace := fyne.MeasureText("M", theme.TextSize(), fyne.TextStyle{Monospace: true})
min := canvas.NewRectangle(color.RGBA{})
min.SetMinSize(fyne.NewSize(monospace.Width*20, monospace.Height*5))
entry := widget.NewEntry()
label := widget.NewLabel("")
entry.OnSubmitted = func(v string) {
label.SetText(fmt.Sprintf("%q", v))
}
window.SetContent(container.NewMax(min, container.NewGridWithRows(2, entry, label)))
window.Show()
application.Run()
}
Fyne version
develop
Go compiler version
1.20.5
Operating system and version
Windows 11
Additional Information
No response
Activity