mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
V2 of input suggestions API.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.suggester import SuggestFromList
|
||||
from textual.widgets import Input
|
||||
|
||||
|
||||
@@ -14,7 +15,7 @@ class FruitsApp(App[None]):
|
||||
"""
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Input("straw", suggestions=fruits)
|
||||
yield Input("straw", suggester=SuggestFromList(fruits))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user