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
ToggleControl of block InspectorControls passes event object as parameter to onChange. Whereas other InspectorControls controls pass value of the control.
Steps to Reproduce (for bugs)
Add ToggleControls and any other control e.g. RangeControl
Make onChange callback console log the argument received.
Compare ToggleControl and Range control outputs.
Expected Behavior
onChange callback should be passed event.target.checked as argument (Other controls pass event.target.value).
Current Behavior
Whole event object is passed which is not consistent with other controls.
Possible Solution
Well... Will try to do a PR... Idea is to do an anonymous function that calls onChange callback with checked property of the event target.
Screenshots / Video
Todos
Tests
Documentation
The text was updated successfully, but these errors were encountered:
Issue Overview
ToggleControl of block
InspectorControls
passes event object as parameter toonChange
. Whereas other InspectorControls controls pass value of the control.Steps to Reproduce (for bugs)
ToggleControls
and any other control e.g.RangeControl
onChange
callback console log the argument received.Expected Behavior
onChange
callback should be passedevent.target.checked
as argument (Other controls passevent.target.value
).Current Behavior
Whole event object is passed which is not consistent with other controls.
Possible Solution
Well... Will try to do a PR... Idea is to do an anonymous function that calls
onChange
callback withchecked
property of the event target.Screenshots / Video
Todos
The text was updated successfully, but these errors were encountered: