Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added args val for callback on top of text
Browse files Browse the repository at this point in the history
norton120 committed Sep 16, 2024
1 parent 8048712 commit 3ab7975
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion textcomplete/__init__.py
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
Optional,
TypedDict,
TypeVar,
Tuple,
Union,
)

@@ -133,6 +134,7 @@ def textcomplete(
stop_enter_propagation: bool = False,
dynamic_width: bool = True,
dropdown_style: str = "",
args: Optional[Tuple] = tuple(),
) -> Optional[TextcompleteResult]:
# Call through to our private component function. Arguments we pass here
# will be sent to the frontend, where they'll be available in an "args"
@@ -164,7 +166,7 @@ def textcomplete(
)

if on_select and result:
on_select(result)
on_select(result, *args)

# We could modify the value returned from the component if we wanted.
# There's no need to do this in our simple example - but it's an option.

0 comments on commit 3ab7975

Please sign in to comment.