Yeah, I agree. I think it’s very rare for someone to actually want to
toggle a value like that.
ie. “I don’t know/care what the current value of this is just make it the opposite of that”
It’s more common for
toggle to be used when someone thinks they knows the state of the value and wants to implicitly set it to the other state.
This leads to all kinds of races and other bugs resulting from the assumption of the state being wrong and thus the
toggle having the opposite of the desired effect.
multi-select checkboxes/dropdowns is a great example of the kind of thing where the event from the user has a specific intention that isn’t to
toggle but to explicitly add/remove a selection, or enabled/disabled a checkbox.
I think actually wanting to
toggle is rare enough that having it included in core would just encourage people to create these kinds of bugs.