Related Objects
Event Timeline
I considered it and in my opinion .toggle() is intuitive enough, matches the convention established by jQuery and is a lot harder to mistype than .toggleVisibility(). ;) More considerations would be welcome.
The problem comes from something like ToggleSwitchWidget.
var switch = new ToggleSwitchWidget(); // Hides and shows switch.toggle(); // Changes the value switch.setValue( true );
You have to admit, that's a little awkward.
One of the things we currently have working against us here is our implementation of switches/checkboxes. In OOjs UI a checkbox or switch has a boolean value that relates to it's "selected" state, whereas HTML such fields have a value which is persistent no matter the sate and a separate "selected" property indicating the state. Not only does this mean we can't model HTML forms correctly at the moment, but it also means we run into this sort of confusion.
And now that we ditched jQuery's .toggle(), I'm starting to think that this could be worthwhile to prevent the two from being confused.
Boldly resetting task status after five years. This task should be either open (and valid), or declined (we are against doing this).