-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 does not show the last (few) changes when updating a binding.String in a fast succession #4082
Comments
Probably related: package main
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/data/binding"
"fyne.io/fyne/v2/layout"
"fyne.io/fyne/v2/widget"
)
func main() {
a := app.New()
w := a.NewWindow("Test")
w.Resize(fyne.NewSize(700, 300))
// Username
sshUsernameBinding := binding.NewString()
sshUsernameControl := widget.NewEntryWithData(sshUsernameBinding)
sshUsernameControl.SetPlaceHolder("Username")
sshUsernameBinding.Set("Test")
w.SetContent(container.New(layout.NewFormLayout(), widget.NewLabel("Username"), sshUsernameControl))
w.CenterOnScreen()
w.ShowAndRun()
} |
I think this might have been fixed on the |
Is this related to #4061 ? |
This is still happening on 2.4.3. Here is my test case where you can't get the widget to show the value "2" using the button. I think its a pretty big regression of the Entry widget with a binding - since the value shown to the user is wrong in many cases. I may have to revert back to before the bug on my project or use a different widget. package main
import (
"time"
fyne "fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/data/binding"
"fyne.io/fyne/v2/widget"
)
func main() {
fyneApp := app.NewWithID("TestApp")
win := fyneApp.NewWindow("TestWindow")
win.Resize(fyne.NewSize(500, 500))
boundString := binding.NewString()
win.SetContent(
container.NewVBox(
widget.NewEntryWithData(boundString),
widget.NewButton("change", func() {
_ = boundString.Set("1")
time.Sleep(10 * time.Millisecond)
_ = boundString.Set("2")
}),
),
)
win.Show()
fyneApp.Run()
} |
fixed on develop, will pick into 2.4.4 |
Checklist
Describe the bug
As discussed in Slack (https://gophers.slack.com/archives/CB4QUBXGQ/p1689959990702439) there seems to be an issue when a
binding.String
is bound to anEntry
and is quickly updated multiple times. In that case, theEntry
does not get all the last changes until the binding is updated again.How to reproduce
a
andb
randomly counting from 0 to 19. But you will just see a nothing or a few entries. Then after 5 seconds, it will add afinal
string and suddenly renders all missing parts.Screenshots
Example code
Fyne version
v2.3.6-0.20230720061213-19e0c73660eb
Go compiler version
1.20.6
Operating system and version
Linux WSL2, Windows 10
Additional Information
No response
The text was updated successfully, but these errors were encountered: