You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
In Fyne version 2.5.0, the validation function for the Entry widget within a Form widget behaves abnormally when text is pasted directly from the clipboard. The same code works as expected in version 2.4.5, where the validation is triggered correctly upon pasting text.
How to reproduce
Use the provided sample code.
Run the application in Fyne 2.5.0.
Paste any text into the Entry widget from the clipboard.
Observe that the validation function is not triggered, allowing the form to proceed with potentially invalid input.
Screenshots
I have attached two GIFs demonstrating the issue:
Fyne 2.4.5: Validation behaves normally and is triggered correctly when text is pasted into the Entry.
Fyne 2.5.0: Validation behaves abnormally and is not triggered when text is pasted.
Example code
package main
import (
"errors""log""fyne.io/fyne/v2""fyne.io/fyne/v2/app""fyne.io/fyne/v2/widget"
)
funcmain() {
myApp:=app.New()
myWindow:=myApp.NewWindow("Form Widget")
entry:=widget.NewEntry()
entry.Validator=func(sstring) error {
iflen(s) ==0 {
returnerrors.New("entry cannot be empty")
}
returnnil
}
form:=&widget.Form{
Items: []*widget.FormItem{ // we can specify items in the constructor
{Text: "Entry", Widget: entry}},
OnSubmit: func() { // optional, handle form submissionlog.Println("Form submitted:", entry.Text)
},
}
myWindow.SetContent(form)
myWindow.Resize(fyne.NewSize(300, 50))
myWindow.ShowAndRun()
}
Fyne version
2.5.0
Go compiler version
1.20.7
Operating system and version
Windows 10 19045.4651
Additional Information
No response
The text was updated successfully, but these errors were encountered:
zhironghsu
changed the title
Form Widget Entry Validation Not Triggering on Paste in Fyne 2.5.0
Abnormal Form Widget Entry Validation Behavior on Paste in Fyne 2.5.0
Aug 8, 2024
Checklist
Describe the bug
In Fyne version 2.5.0, the validation function for the Entry widget within a Form widget behaves abnormally when text is pasted directly from the clipboard. The same code works as expected in version 2.4.5, where the validation is triggered correctly upon pasting text.
How to reproduce
Screenshots
I have attached two GIFs demonstrating the issue:
Fyne 2.4.5: Validation behaves normally and is triggered correctly when text is pasted into the Entry.
Fyne 2.5.0: Validation behaves abnormally and is not triggered when text is pasted.
Example code
Fyne version
2.5.0
Go compiler version
1.20.7
Operating system and version
Windows 10 19045.4651
Additional Information
No response
The text was updated successfully, but these errors were encountered: