-
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
Fix separator and spacer blocks after api v2 refactoring. #26157
Conversation
Size Change: +8 B (0%) Total Size: 1.19 MB
ℹ️ View Unchanged
|
3ec83bb
to
39872e0
Compare
@@ -48,7 +49,7 @@ const SpacerEdit = ( { | |||
|
|||
return ( | |||
<> | |||
<div { ...useBlockProps() }> |
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.
Ideally we should avoid this and make the wrapper itself resizable. I'll look into that.
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.
yes, I tried it and I believe there's something with the "ref" not being forwarded properly to the third-party dependency.
@@ -0,0 +1,3 @@ | |||
# View | |||
|
|||
A drop-in replacement for the div element that works across devices. |
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.
Really like this 😍
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.
LGTM! Tested it on the mobile demo app both iOS and Android, the Spacer
and Separator
block work as expected.
Thanks for changing the code to make it work for both web and mobile!
This also introduces the "View" primitive between mobile and web. The main question for me here is what props this primitive should accept. Implicitly here, it already accepts a bunch of web props (className, style, role, ref) generated by useBlockProps but I guess the native version of useBlockProps could generate different ones (or we find a device-agnostic way to define these styles and properties).