-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Create a single cancel callback for each unique input. #2599
Conversation
time.sleep(2.1) | ||
dash_duo.wait_for_text_to_equal("#output1", "initial") | ||
|
||
dash_duo.server_url = dash_duo.server_url + "/2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of having 2 pages for this test?
As far as I can tell, this effectively tests the same thing twice (once for each page).
Did you mean to test switching pages while a callback is pending? Or do I misunderstand what you're looking for in this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before you couldn't use the same input for multiple background callbacks and if you used one that is on every page and one that is only on one page it also bugged.
Testing page switching is not easy to get feedback for the cancellation, this test just use button instead with the cases above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh, I see now. I missed that #cancel
persists across pages.
Maybe this would be easier to understand at a glance if cancel
was named something more descriptive like shared_cancel
or persistent_cancel
.
Just a minor thought, otherwise this looks great to me.
Partial fix for #2588, create a cancel callback for each unique cancel input of background callback. This allow to use a location input shared across pages (
_pages_location_container
) in multiple background callbacks cancel.