-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[Block Editor]: Fix onHover
errors at BlockPattern
#47466
Conversation
Size Change: +8 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
Flaky tests detected in 270497f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4017095702
|
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.
Thanks for the follow-up, @ntsekouras!
I have confirmed that this PR does not generate a browser console error when mousing over a block pattern list item for which onHover is not defined.
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.
This looks good, Nik!
We can also use noop
function as default for onHover
maybe even for onClick
.
What?
A small follow up for: #47316
BlockPattern component is used in more places where
onHover
is not defined. This PR fixes that. I didn't add a defaultnoop
function, because I don't think there is the need to even call something if not defined.Testing Instructions
Patterns Explorer
orreplace
(block settings menu) in a Template Part