Add ComboBox widget (searchable select)#6467
Open
steveanil wants to merge 1 commit intoTextualize:mainfrom
Open
Add ComboBox widget (searchable select)#6467steveanil wants to merge 1 commit intoTextualize:mainfrom
steveanil wants to merge 1 commit intoTextualize:mainfrom
Conversation
Implements a ComboBox widget that combines a text Input with a filterable OptionList overlay, addressing Textualize#4167.
Collaborator
|
The |
Author
In the issue #4167, I was reading the details of the conversation and you mentioned that it should be a separate new widget that has a drop down list. This new widget filters the list itself as you type and the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is AI generated by Claude
Link to issue or discussion
#4167
cc @willmcgugan
What this adds
A
ComboBoxwidget that combines a textInputwith a filterableOptionListoverlay — a standard "searchable select" / combobox pattern.Design decisions
Inputat all times. The parentComboBoxhascan_focus=False. Arrow keys bubble up fromInputand are proxied to the overlay, so the user can type and navigate without a focus ownership conflict.Input, the overlay collapses via aComboBoxInput.LostFocusmessage.ComboBox.Selectedmessage is posted on selection, following the same pattern asSelect.Usage
Files changed
src/textual/widgets/_combo_box.pysrc/textual/widgets/combo_box.pysrc/textual/widgets/__init__.pyComboBoxin the widget namespacesrc/textual/widgets/__init__.pyitests/test_combo_box.py