Skip to content
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

Remove casting to user's custom type when passing data #385

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

arrenanv
Copy link

@arrenanv arrenanv commented Apr 13, 2024

This commit is aimed to fix issue with doublecasting when sequence of enum members is passed as items of Select-like widgets

@@ -120,7 +120,7 @@ async def _process_item_callback(
callback,
self.managed(manager),
manager,
self.type_factory(data),
data,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like breaking normal select

@@ -181,7 +181,7 @@ async def _process_click(
await self.on_item_click.process_event(
callback, select, manager, self.type_factory(item_id),
)
await self._on_click(callback, select, manager, str(item_id))
Copy link
Author

@arrenanv arrenanv Apr 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, would it be correct to return type casting in Select and remove it in StatefulSelect (line 182)? Also make a condition if item_id is the member of enum, then pass it as self.item_id_getter(item_id) instead of just casting to str.

@Tishka17
Copy link
Owner

Any updates?

@arrenanv
Copy link
Author

Currently not enough time, too much work on me. I will try to fix the issue on the next week maybe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants