-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add disablemethod
flag to button and slider steps
#1695
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
Comments
Other considerations: Maybe this should be the affirmatively-named |
Maybe not |
Sorry, just |
Right. But there would be no way to restyle it to that value. In other words, there are no |
Ohhhh, I see your point. Got it. Yeah, then I like |
Thanks for opening @rreusser, I definitely have some good use-cases for this -- where can I find the naming of these events? Is there official documentation anywhere? |
Conclusion:
I don't love name |
👍 for Ideally it seems like we'd want a way to defer the action, but let you invoke it later - like if the native plotly.js invocation of the animation or whatever were passed into the event that you're going to bind to as a callback. But we can implement that later. For now, lets give it a more precise name at least. I want to say something like |
Another option is a string instead of a Boolean to make room for also maybe disabling the two way binding, though not sure why that'd be desirable. It just |
Sure, I could go for |
Can you clarify the last point? I'm not sure I follow. |
if the user sets Anyway not a big deal, that's just a documentation issue; the functionality sounds good. |
Ahhh, I see. Yes, I think the burden is on the user at this advanced level of usage. |
And a small nitpick that it doesn't feed the new state into controls that way. Controls read from |
Ah, I see. That's good, and seems like it assuages my fears for correlated components. Let me just follow through the implications for an
|
Correct. 90% of the difficulty in implementing the slider was getting it to avoid updating itself while updating itself… It accomplishes this with a somewhat carefully 😬 choreographed sequence of async updates and flags related to whether the source of the update is user input or an internal state change. I've been very happy with how well it's worked. You make a good point about what happens if you do something bizarre like making it self-inconsistent by overriding the behavior with something that's not what it says it's going to do. To be honest, I don't know exactly what will happen in that case, but I think it's worth a quick experiment to check—though I do think it's not a particularly important corner case since you can always do weird things like |
Thanks, yes. Closing. |
Uh oh!
There was an error while loading. Please reload this page.
An emerging pattern for examples of sufficient complexity is that it's becoming necessary to hook into components via events instead of strictly the command api interface. This might be the case if you have to, say, perform a couple precisely sequenced async actions before animating.
However, a problem with sliders, for example, is that bailing on specifying
method
andargs
as you normally would breaks the coupling that puts the slider in the correct position when you change the frame via some other pathway, like a play button.I propose two things:
disablemethod
forupdatemenus
andsliders
buttons/steps that leaves everything else unaffected and just skips actually executing the method so that you can hook into an event and call it yourself in a more sophisticated way. Otherwise the behavior will be unaffected.null
for a method. Currently the supplydefaults enum blocks what seems like a legitimate usage when you just want a slider with no associated api call. (i.e. why have events if you can't use them?)/cc @etpinard @alexcjohnson @bpostlethwaite for what might need to be expedited feedback and fixes
The text was updated successfully, but these errors were encountered: