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
Pasting text into a MultiLineEntry with custom validation won't enable the submit button
How to reproduce
- Run example code
- Paste text into MultiLineEntry
- Submit button still disabled
Screenshots
No response
Example code
package main
import (
"errors"
"fmt"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/widget"
)
func main() {
w := app.New().NewWindow("test")
w.Resize(fyne.NewSize(500, 100))
txt := widget.NewMultiLineEntry()
txt.Validator = func(s string) error {
if s == "" {
return errors.New("empty")
}
return nil
}
form := &widget.Form{
OnSubmit: func() {
fmt.Println("OnSubmit")
},
}
form.Append("txt", txt)
w.SetContent(form)
w.ShowAndRun()
}
Fyne version
fyne.io/fyne/v2 v2.5.0
Go compiler version
go1.22.5 darwin/arm64
Operating system and version
macOS 14.5, windows 10
Additional Information
I was able to fix it with this workaround:
txt.OnChanged = func(s string) {
_ = txt.Validate()
}
Activity