Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- Allow changing the `DropZone` file if allowMultiple is false ([#2737](https://github.com/Shopify/polaris-react/pull/2737))
- Fixed `DropZone` not supporting new file selection when `allowMultiple` is `false` ([#2737](https://github.com/Shopify/polaris-react/pull/2737)) ([#2737](https://github.com/Shopify/polaris-react/pull/2737))
- Fixed `DropZone` not supporting new file selection when `allowMultiple` is `false` ([#2737](https://github.com/Shopify/polaris-react/pull/2737))
- Fixed `Pagination` sizing on small screens with tooltips ([2747](https://github.com/Shopify/polaris-react/pull/2747))

### Documentation

Expand Down
9 changes: 9 additions & 0 deletions src/components/Pagination/Pagination.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ $stacking-order: (
.Button {
flex: 1 0 auto;
}

span {
flex: 1 0 auto;

// stylelint-disable-next-line selector-max-specificity, max-nesting-depth, selector-max-combinators
.Button {
width: 100%;
}
Comment on lines +33 to +35
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting a linting error because it's doing 3 levels of nesting. Anyone know a better way to do this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the span will get added inside the other component I think this is your best bet. Good job on explicitly adding the span in the prop, it avoids surprises.

}
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions src/components/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,18 @@ export function Pagination({

const constructedPrevious =
previousTooltip && hasPrevious ? (
<Tooltip content={previousTooltip}>{previousButton}</Tooltip>
<Tooltip activatorWrapper="span" content={previousTooltip}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice that you specify the wrapper!

{previousButton}
</Tooltip>
) : (
previousButton
);

const constructedNext =
nextTooltip && hasNext ? (
<Tooltip content={nextTooltip}>{nextButton}</Tooltip>
<Tooltip activatorWrapper="span" content={nextTooltip}>
{nextButton}
</Tooltip>
) : (
nextButton
);
Expand Down