Skip to content

Commit 4ba155b

Browse files
committed
Docstrings
1 parent 9695d04 commit 4ba155b

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

docs/widgets/select.md

-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ The `Select` widget has a `type_to_search` attribute which allows you to type to
9898

9999
## Reactive Attributes
100100

101-
102101
| Name | Type | Default | Description |
103102
|------------|--------------------------------|------------------------------------------------|-------------------------------------|
104103
| `expanded` | `bool` | `False` | True to expand the options overlay. |

src/textual/widgets/_select.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,21 @@ class UpdateSelection(Message):
6363
def __init__(self, type_to_search: bool = True) -> None:
6464
super().__init__()
6565
self._type_to_search = type_to_search
66+
"""If True (default), the user can type to search for a matching option and the cursor will jump to it."""
67+
6668
self._search_query: str = ""
69+
"""The current search query used to find a matching option and jump to it."""
70+
71+
self._search_reset_delay: float = 0.7
72+
"""The number of seconds to wait after the most recent key press before resetting the search query."""
6773

6874
def on_mount(self) -> None:
6975
def reset_query() -> None:
7076
self._search_query = ""
7177

72-
self._search_reset_timer = Timer(self, 0.7, callback=reset_query)
78+
self._search_reset_timer = Timer(
79+
self, self._search_reset_delay, callback=reset_query
80+
)
7381

7482
def watch_has_focus(self, value: bool) -> None:
7583
self._search_query = ""

0 commit comments

Comments
 (0)