[ActionList] Fix spacing above action list title when first in mobile action menu popover #5879
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WHY are these changes introduced?
Fixes #5877
When a page has action groups but no secondary actions, there is not enough spacing above the title of the first action group in the action list popover on mobile.
I can't reproduce the problem in an
ActionListin isolation; it only seems to be present in aPage.WHAT is this pull request doing?
There was a previous PR that fixed this last August by adding a
firstSectionclass to the first section of the action list using theindexwhen mapping acrossfinalSections. However this solution is not reliable as-is because the item at the index of0is not always rendered.Instead of fixing the logic, I decided to go for a CSS solution.
First, set the
padding-topfor every action list title to the increased amount.Then, select all titles that are in sections that are not the first section and set their
padding-topto the smaller amount.I had originally done this by just selecting
.Section:first-child .Titleand setting itspadding-topto the increased amount, but that broke the case where an action list is not sectioned (has only one item in itsactionGroupsarray).Before this PR
After this PR
How to 🎩
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
This can be tophatted by viewing the
Page/Page with action groupsstory in Storybook at a mobile screen size and expanding the action list menu.You can also verify this does not break the
ActionListcomponent in isolation by viewing theAction list/Action list with destructive itemandAction list/Sectioned action liststories.🎩 checklist
README.mdwith documentation changes