Skip to content

Select.selection does not return None if select.value is select.BLANK #5651

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

Closed
Zaloog opened this issue Mar 14, 2025 · 2 comments
Closed

Select.selection does not return None if select.value is select.BLANK #5651

Zaloog opened this issue Mar 14, 2025 · 2 comments

Comments

@Zaloog
Copy link
Contributor

Zaloog commented Mar 14, 2025

The bug

Please give a brief but clear explanation of the issue. If you can, include a complete working example that demonstrates the bug. Check it can run without modifications.

Select.selection does not return None if select.value is select.BLANK, see source code:

@property
    def selection(self) -> SelectType | None:
        """The currently selected item.

        Unlike [value][textual.widgets.Select.value], this will not return Blanks.
        If nothing is selected, this will return `None`.

        """
        value = self.value
        assert not isinstance(value, NoSelection)
        return value

opened a PR #5650

Copy link

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

Copy link

github-actions bot commented Apr 9, 2025

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

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

No branches or pull requests

2 participants