BUG-Docs state element adapters should return tuple[str, str | Icon] #1248
Labels
📄 Documentation
Internal or public documentation
🖰 GUI
Related to GUI
🆘 Help wanted
Open to participation from the community
💥Malfunction
Addresses an identified problem.
🟨 Priority: Medium
Not blocking but should be fixed soon
Bug description
Selector adapter description:
The second sentence directly contradicts the first. The docs also give the default value of
lambda x: str(x)
.See this code and the following questions:
Question 1 - Purpose of first element in adapter return value
I expected that maybe the selection would be uppercase, since it is the id of the adapter return value, but it isn't. Is it used some other way?
Apparently, using
return (aggregation.upper(), aggregation.title(), aggregation.upper())
achieves the functionality I just described -- the selector value would be uppercase. Assuming this is a bug, I would rather the application terminate with a TypeError -- it's a mistake for the app dev to fix rather than to fail gracefully.Question 2 - value_by_id
Should value_by_id be impacted by the adapter? Description:
From this description, I infer that the selection value (in value) is always going to be from the lov, i.e.
list[<this>: str]
orlist[tuple[<this>: str, str | Icon]
(excl. the Enum case).This makes sense and is fine by me, so should
adapter
simply have a return type ofstr | Icon
for the entry label?Expected change
The text was updated successfully, but these errors were encountered: