You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Existing input elements don't have a toggle method. The value of checkboxes for example can be set trough the .value property in JavaScript. Switches only have two states and could easily be toggled. Should the switch support a .toggle method?
The proposed syntax for the toggle method would also allow for an optional force parameter:
mySwitch.toggle(): (force?: boolean)=>boolean
The text was updated successfully, but these errors were encountered:
The Open UI Community Group just discussed [switch] Should the switch have a toggle() method?, and agreed to the following:
RESOLVED: input type="checkbox" switch will not have a toggle() method
The full IRC log of that discussion
<bkardell_> q+
<masonf> q+
<brecht_dr> gregwhitworth: Should there be a toggle method on switch so that we can just call toggle, that changes the value
<gregwhitworth> ack bkardell_
<brecht_dr> bkardell_: This is for the input type variant. Do we still plan to do an element called switch? if so, is there support for that by vendors?
<brecht_dr> bkardell_: If this would apply to input, then i would like the answer to be "no", because input is already weird with all the variants, we shouldn't add more in my opinion.
<gregwhitworth> ack masonf
<brecht_dr> masonf: I had similar questions. I follow among the same lines. There is also a method called click, which is what you might want here
<Travis7> NICK Travis
<brecht_dr> masonf: I'd say let's just do that
<brecht_dr> gregwhitworth: I just wanted to call out that there isa toggle method (in chat meeting: https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/toggle)
<brecht_dr> gregwhitworth: I wonder what are we designing this for? That is the question
<bkardell_> sure... in an ideal world I would like a toggle on an element called switch
<brecht_dr> gregwhitworth: I'm in favour to say no for now, but this is an HTML centric decision
<gregwhitworth> q?
<gregwhitworth> Proposed Resolution: input type="checkbox" switch will not have a toggle() method
<masonf> +1
<bkardell_> +1
<brecht_dr> +1
<gregwhitworth> RESOLVED: input type="checkbox" switch will not have a toggle() method
Question in the explainer: https://open-ui.org/components/switch.explainer/#methods
Existing input elements don't have a toggle method. The value of checkboxes for example can be set trough the
.value
property in JavaScript. Switches only have two states and could easily be toggled. Should the switch support a.toggle
method?The proposed syntax for the toggle method would also allow for an optional
force
parameter:The text was updated successfully, but these errors were encountered: