Skip to content

Commit 261355f

Browse files
authored
[AlphaFilters] Fixes incorrect vertical alignment within component (#8913)
### WHY are these changes introduced? Fixes Shopify/web#88968 ### WHAT is this pull request doing? The label within active filter pills, and the "Clear all" button text were 1px lower than they should have been. This PR addresses that by putting them back where they should be. Before: <img width="1963" alt="Screenshot 2023-04-11 at 10 38 30" src="https://user-images.githubusercontent.com/2562596/231123116-c2f1495e-7c00-4eb9-845a-e96d45b58d7d.png"> After: <img width="1963" alt="Screenshot 2023-04-11 at 10 38 16" src="https://user-images.githubusercontent.com/2562596/231123201-14fea21d-6e42-4ef4-a65b-3b40507c74e3.png"> Storybook URL: https://5d559397bae39100201eedc1-kdasyocdfw.chromatic.com/?path=/story/all-components-alphafilters--with-a-resource-list ### 🎩 checklist - [x] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [x] 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) - [x] Updated the component's `README.md` with documentation changes - [x] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
1 parent 2bad4e3 commit 261355f

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

.changeset/little-ravens-repair.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/polaris': patch
3+
---
4+
5+
Tweaked the vertical alignment of elements within the `AlphaFilters` component

polaris-react/src/components/AlphaFilters/AlphaFilters.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import {Text} from '../Text';
1010
import {UnstyledButton} from '../UnstyledButton';
1111
import {classNames} from '../../utilities/css';
1212
import type {AppliedFilterInterface, FilterInterface} from '../../types';
13-
import {Link} from '../Link';
1413
import {HorizontalStack} from '../HorizontalStack';
1514
import {Box} from '../Box';
1615
import {Spinner} from '../Spinner';
16+
import {Button} from '../Button';
1717

1818
import {FilterPill, SearchField} from './components';
1919
import styles from './AlphaFilters.scss';
@@ -329,11 +329,14 @@ export function AlphaFilters({
329329
styles.MultiplePinnedFilterClearAll,
330330
)}
331331
>
332-
<Link onClick={handleClearAllFilters} removeUnderline>
333-
<Text variant="bodySm" fontWeight="semibold" as="span">
334-
{i18n.translate('Polaris.Filters.clearFilters')}
335-
</Text>
336-
</Link>
332+
<Button
333+
size="micro"
334+
plain
335+
onClick={handleClearAllFilters}
336+
removeUnderline
337+
>
338+
{i18n.translate('Polaris.Filters.clearFilters')}
339+
</Button>
337340
</div>
338341
) : null;
339342

polaris-react/src/components/AlphaFilters/components/FilterPill/FilterPill.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
}
7474

7575
.Label {
76-
display: block;
76+
display: flex;
7777
padding-left: var(--p-space-05);
7878
}
7979
}

0 commit comments

Comments
 (0)