Skip to content

Commit fb373c3

Browse files
authored
Adjust CSS for expanded navigation section to remove unwanted space during collapse/expand (#8655)
<!-- ☝️How to write a good PR title: - Prefix it with [ComponentName] (if applicable), for example: [Button] - Start with a verb, for example: Add, Delete, Improve, Fix… - Give as much context as necessary and as little as possible - Prefix it with [WIP] while it’s a work in progress --> ### WHY are these changes introduced? Resolves #8653 <!-- Context about the problem that’s being addressed. --> ### WHAT is this pull request doing? There is a synchronization issue in which we have a sort of half-open state for navigation sections. This moves the style from that half-open state to the fully-open state. The half-open state might still exist (because `Secondary` uses `Collapsible` which wants to do animations) but AFAIK it's not causing any unwanted behaviour. <!-- ℹ️ Delete the following for small / trivial changes --> ### How to 🎩 This can be tested if you check out my Navigation storybook improvements in #8652 and cherry pick this commit over to that branch, or vice versa. Try switching between sections, and record a high-speed video of it to see the difference. 🖥 [Local development instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development) 🗒 [General tophatting guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md) 📄 [Changelog guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog) ### 🎩 checklist - [ ] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [ ] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [x] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [ ] Updated the component's `README.md` with documentation changes - [ ] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
1 parent 3e7e083 commit fb373c3

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

.changeset/smart-pillows-buy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/polaris': minor
3+
---
4+
5+
Adjust CSS for expanded navigation section to remove unwanted space during collapse/expand

polaris-react/src/components/Navigation/Navigation.scss

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,14 +381,11 @@ $disabled-fade: 0.6;
381381
margin-left: 0;
382382
overflow-x: visible;
383383

384-
&.isExpanded {
385-
margin-bottom: var(--p-space-2);
386-
}
387-
388384
.List {
389385
margin: 0;
390386
padding: 0;
391387
list-style: none;
388+
margin-bottom: var(--p-space-2);
392389
}
393390

394391
.Item {

polaris-react/src/components/Navigation/components/Item/Item.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ export function Item({
303303

304304
const SecondaryNavigationClassName = classNames(
305305
styles.SecondaryNavigation,
306-
showExpanded && styles.isExpanded,
307306
!icon && styles['SecondaryNavigation-noIcon'],
308307
);
309308

0 commit comments

Comments
 (0)