-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Video Block: Fix browser warning error when settings are toggled #46835
Conversation
/> | ||
<ToggleControl | ||
label={ __( 'Playback controls' ) } | ||
onChange={ toggleFactory.controls } | ||
checked={ controls } | ||
checked={ !! controls } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strictly speaking, this is not necessary since control
has a default value, but I handled this to unify with the other controls.
Size Change: +2 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@t-hamano Looks good.
I don't believe there are any problems with the code changes in the PR, but I am not able to reproduce the issue on trunk. Do I need any specific settings in devtools? |
Sorry for the inadequate explanation. You can check this error by setting |
I'm a muppet, I had |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to reproduce the error, and the PR solves it. The settings still work as expected.
What?
This PR fixes the browser warning error that occurs when the toggle control value is changed in the block sidebar.
ee3a0798b500d66fe01f480b29bf0bd7.mp4
Why?
This is because the variables given as the initial value are
undefined
.How?
I used
!!
to convert them to boolean values.Testing Instructions