Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reset_function callback option #58

Closed
hoggatt opened this issue Aug 28, 2024 · 2 comments
Closed

Add reset_function callback option #58

hoggatt opened this issue Aug 28, 2024 · 2 comments

Comments

@hoggatt
Copy link

hoggatt commented Aug 28, 2024

Add a callback function that can be run in the case of a reset.

This is useful if you want to change some value in your app in the case of a reset. Pulling from my fork that, unfortunately, I have so it won't let me make a pull request.

To the main function add this argument:
reset_function: Callable[[], None] = None,

With this doc string:

reset_function (Callable[[], None], optional):
    Function that is called after the user has reset the combobox. Defaults to None.

Then this needs to be in the if interaction == "reset": block, before the return:

if reset_function is not None:
    reset_function()
@hoggatt
Copy link
Author

hoggatt commented Aug 28, 2024

Here is the docstring in the readme:


reset_function: Callable[[], None] = None

Function that will be called when the combobox is reset.

@m-wrzr
Copy link
Owner

m-wrzr commented Sep 1, 2024

Thanks for the input! I'll add it to the next version 👍 #59

@m-wrzr m-wrzr closed this as completed Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants