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
Entry Validation Broken when using Data binding #1890
Comments
Even calling Simplified code that still reproduces this: package main
import (
"fmt"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/data/binding"
"fyne.io/fyne/v2/widget"
)
func main() {
a := app.New()
w := a.NewWindow("Entry Error")
data := binding.NewString()
entry := widget.NewEntryWithData(data)
entry.Validator = func(s string) (err error) {
err = fmt.Errorf("this is an error")
entry.SetValidationError(err)
return
}
w.SetContent(entry)
w.Resize(w.Content().MinSize().Add(fyne.NewSize(80, 0)))
w.ShowAndRun()
} |
Ah data binding. I see now. Maybe the data binding error is stomping over the validation that is set? |
fixed on |
is this fixed in master ? |
It was fixed back at v2.1.0 - are you certain you are seeing the exact same issue? |
@andydotxyz I was seeing the exact same issue. I used a workaround where I extract the data from the entry directly instead of the binding. But now when I revert the code to the one with binding, the vaildation works! |
Describe the bug:
Adding a Validator to an Entry that does not belong to a form appears to have no effect on the visual validation of said field, so the point where returning an error from the
StringValidator
results in a checkmark being shown as if the field passed validation.To Reproduce:
Steps to reproduce the behaviour:
Screenshots:
Example code:
Device (please complete the following information):
1.15.6 linux/amd64
2.0.0
The text was updated successfully, but these errors were encountered: