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
On Windows, when a selection widget is created with a list containing an empty string (eg: toga.Selection(items=['1','a','','4']) ), the widget returns '' for the "value" attribute.
On Android, the selection's "value" attribute is set to None if the selection item is an empty string.
I don't have MacOS, iOS, or Linux devices so I don't know what happens there.
Steps to reproduce
Create Beeware Project
Go to the app.py file
Create a list "list_1" containing an empty string
Create the base app class with the startup function and setup main box + window
In the startup function, create a selection with the items being that of list_1. Store it as a class attribute for future access.
Define a class function that outputs the selection value via print or info_dialog.
Create Button to call the output function
Add Selector & Button to main box
Compile the code for both Windows and Android & launch them.
Select the empty item of the selector
Press the button
Watch as the devices disagree on the value.
Expected behavior
I would expect the selector value attribute to be an empty string as that was what the item was, and that is what the selector widget understands when values are written to it.
Thanks for the report; looks like an edge case that we've missed in testing. The fault is almost certainly with the get_value() handler and the way it's interpreting the return value from the underlying Android API.
Describe the bug
On Windows, when a selection widget is created with a list containing an empty string (eg: toga.Selection(items=['1','a','','4']) ), the widget returns '' for the "value" attribute.
On Android, the selection's "value" attribute is set to None if the selection item is an empty string.
I don't have MacOS, iOS, or Linux devices so I don't know what happens there.
Steps to reproduce
Expected behavior
I would expect the selector value attribute to be an empty string as that was what the item was, and that is what the selector widget understands when values are written to it.
Screenshots
The source code I used:
On Windows:
On Android:
Environment
Windows 8.1 / Android 11
Logs
Windows:
briefcase.2022_12_27-17_09_47.run.log
Android:
briefcase.2022_12_27-17_17_14.run.log
Additional context
No response
The text was updated successfully, but these errors were encountered: