You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`PathInputAutoComplete` has a bunch of parameters that can be used to customize the behavior - check the docstring for more details. It'll also cache directory contents after reading them once - but you can clear the cache if you need to using the `clear_directory_cache` method.
214
+
`PathAutoComplete` has a bunch of parameters that can be used to customize the behavior - check the docstring for more details. It'll also cache directory contents after reading them once - but you can clear the cache if you need to using the `clear_directory_cache` method.
215
215
216
216
## Dynamic Data with Callbacks
217
217
@@ -225,15 +225,15 @@ The app below displays the length of the text in the input widget in the prefix
225
225
from textual.app import App, ComposeResult
226
226
from textual.widgets import Input
227
227
228
-
from textual_autocomplete importInputAutoComplete
228
+
from textual_autocomplete importAutoComplete
229
229
from textual_autocomplete._autocomplete import DropdownItem, TargetState
@@ -262,13 +262,13 @@ Notice the count displayed in the prefix increment and decrement based on the ch
262
262
263
263
## Customizing Behavior
264
264
265
-
If you need custom behavior, `InputAutoComplete` is can be subclassed.
265
+
If you need custom behavior, `AutoComplete` is can be subclassed.
266
266
267
-
A good example of how to subclass and customize behavior is the `PathInputAutoComplete` widget, which is a subclass of `InputAutoComplete`.
267
+
A good example of how to subclass and customize behavior is the `PathAutoComplete` widget, which is a subclass of `AutoComplete`.
268
268
269
269
Some methods you may want to be aware of which you can override:
270
270
271
-
-`get_candidates`: Return a list of `DropdownItem` objects - called each time the input changes or the cursor position changes. Note that if you're overriding this in a subclass, you'll need to make sure that the `get_candidates` parameter passed into the `InputAutoComplete` constructor is set to `None` - this tells `textual-autocomplete` to use the subclassed method instead of the default.
271
+
-`get_candidates`: Return a list of `DropdownItem` objects - called each time the input changes or the cursor position changes. Note that if you're overriding this in a subclass, you'll need to make sure that the `get_candidates` parameter passed into the `AutoComplete` constructor is set to `None` - this tells `textual-autocomplete` to use the subclassed method instead of the default.
272
272
-`get_search_string`: The string that will be used to filter the candidates. You may wish to only use a portion of the input text to filter the candidates rather than the entire text.
273
273
-`apply_completion`: Apply the completion to the target input widget. Receives the value the user selected from the dropdown and updates the `Input` directly using it's API.
274
274
-`post_completion`: Called when a completion is selected. Called immediately after `apply_completion`. The default behaviour is just to hide the completion dropdown (after performing a completion, we want to immediately hide the dropdown in the default case).
0 commit comments