-
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
BoxControl: Allow configurable sides #30606
Conversation
Size Change: +42.7 kB (+3%) Total Size: 1.46 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.
This looking good overall, just wondering whether an array prop is better.
Thanks for extracting this. Potentially we could consider adding a storybook story with an example of that.
Thanks for the quick feedback @youknowriad! I can definitely look to switch to an array prop. I'll make some time tomorrow to make these updates and address any other feedback. Appreciate your assistance on 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.
This is looking good.
Maybe we can consider this
Thanks for extracting this. Potentially we could consider adding a storybook story with an example of that.
Also, some thing I've been thinking about: what happens when you pass 0 or 1 side:
- Should we ignore the prop when sides is an empty array? (make it work like undefined)
- Should we not render the "toggle" to switch between merged state and unmerged state when there's only one side?
They sound like some good improvements. I'll make it happen. |
The BoxControl will now treat an empty array the same as undefined. If there is only one side selected in the config, the BoxControl will not display the "unlink" button.
Would the story be acceptable as a separate PR? It's not something I've looked at before but it would be good to take some time and update it with examples of the new features. |
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 to me. Thanks for the iterations.
And yeah a separate PR for the story would be good.
Storybook updates can be found in #31029 |
Description
This allows for the
BoxControl
component to accept a newsides
prop allowing omission of specific sides. For example, with this you could now choose to only allow editing of top and bottom values.This was originally part of #29363 where it was used to manage top/bottom margins on the separator block. It has been extracted into this PR for finer granularity.
How has this been tested?
Manually.
Test Instructions
The easiest method to test this updated
BoxControl
will be to test #30607.That PR is based upon this one and through checking it out and testing it, this updated
BoxControl
will also be tested.Screenshots
Types of changes
New feature.
Checklist:
*.native.js
files for terms that need renaming or removal).