-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Struct binding fails to reload with slice field #2607
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
Comments
@andydotxyz Looking at the surrounding code it looks like only singular, primitive types are supported for struct binding. Is this expected or just something that hasn't surfaced yet? For example, I can try comparing the previous value with |
I have fixed the panic in the v2.1.2 bugfix release. Adding true support for slice content in struct mapping will require a bit more work, so keeping this open for the main work. |
Because the panic is fixed this will be de-prioritised a little. |
Describe the bug:
Whenever there is a slice of struct in a bound struct, the Reload method will always panic. I tried a few different permutations to see if it mattered whether the slice was of value or pointer, or if it was initialized or not, and all failed. However, reloading a bound struct with no slices in it works fine.
Based on the stack trace, the panic is originating here.
https://github.com/fyne-io/fyne/blob/master/data/binding/mapbinding.go#L292
To Reproduce:
Steps to reproduce the behaviour:
https://play.golang.org/p/xvfx58--S66
Example code:
See playground link:
https://play.golang.org/p/xvfx58--S66
Device (please complete the following information):
The text was updated successfully, but these errors were encountered: