Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pagination] Mobile? #22380

Open
1 of 2 tasks
borm opened this issue Aug 27, 2020 · 9 comments
Open
1 of 2 tasks

[Pagination] Mobile? #22380

borm opened this issue Aug 27, 2020 · 9 comments
Labels
component: pagination This is the name of the generic UI component, not the React module! new feature New feature or request

Comments

@borm
Copy link

borm commented Aug 27, 2020

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 馃槸

image

Expected Behavior 馃

image

Steps to Reproduce 馃暪

Steps:

  1. go to https://material-ui.com/components/pagination/ on mobile browser or toggle Google Chrome to mobile view, iPhone 5 to X

Your Environment 馃寧

Tech Version
Material-UI v4.10.1
@borm borm added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 27, 2020
@oliviertassinari oliviertassinari added the component: pagination This is the name of the generic UI component, not the React module! label Aug 27, 2020
@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 27, 2020

@borm What change do you have in mind, how would it work? I have been wondering about this problem since we introduced the component, I'm not sure we have many great options. Things I have seen in the wild:

  1. Shrink it to a version that is not really usable https://elastic.github.io/eui/#/navigation/pagination? Not sure.
  2. Scrollable container keep on a single line? Not sure.
  3. Add a uniform margin? Why not? It's an easy win.
diff --git a/packages/material-ui-lab/src/PaginationItem/PaginationItem.js b/packages/material-ui-lab/src/PaginationItem/PaginationItem.js
index 171041c299..ad4988dc6b 100644
--- a/packages/material-ui-lab/src/PaginationItem/PaginationItem.js
+++ b/packages/material-ui-lab/src/PaginationItem/PaginationItem.js
@@ -20,7 +20,7 @@ export const styles = (theme) => ({
     minWidth: 32,
     height: 32,
     padding: '0 6px',
-    margin: '0 3px',
+    margin: 3,
     color: theme.palette.text.primary,
   },
   /* Styles applied to the root element if `type="page"`. */

IMHO 3. would be good enough cc @mbrookes

@oliviertassinari oliviertassinari removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 27, 2020
@oliviertassinari oliviertassinari changed the title Mobile Pagination [Pagination] Mobile? Aug 27, 2020
@borm
Copy link
Author

borm commented Aug 27, 2020

@oliviertassinari, In my mind i have only one change,
calculate how many items can be placed in container and place it

  1. not worked for me in emulation mode, Google Chrome
  2. bad solution
  3. very simple and not fully true

image

@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 27, 2020

calculate how many items can be placed in container and place it

We would need or make sure it doesn't introduce a layout shift during the initial server-side render and that it would still allow SEO crawlers to do their job.

Note that on mobile, infinite scrolling or simple next and previous buttons are often preferable to the usage of the Pagination component.

I agree that it could be interesting to display fewer items on mobile, for the previous generation of phones that are smaller in width.

Have you considered pagination like https://www.shutterstock.com/search/tree?page=2?

Capture d鈥檈虂cran 2020-08-29 a虁 13 48 18

@oliviertassinari oliviertassinari added the new feature New feature or request label Aug 27, 2020
@borm
Copy link
Author

borm commented Aug 27, 2020

hm, totally agreed with u about ssr
but i think we can do something like display: none for some items on client side, so markup will be same

@mbrookes
Copy link
Member

i think we can do something like display: none for some items on client side,

The pagination displays the number of items needed to display a stable pagination. Which ones do you propose to hide?

@borm
Copy link
Author

borm commented Aug 27, 2020

its a good question, and in the end it can have hard logic, mb something like google?
image

@borm
Copy link
Author

borm commented Aug 27, 2020

also i think a good idea
image

https://www.pinterest.com/pin/106538347421972868/

@mbrookes
Copy link
Member

mb something like google?

So basically what @oliviertassinari proposed a couple of comment back? (ShutterStock)

@borm
Copy link
Author

borm commented Aug 27, 2020

So basically what @oliviertassinari proposed a couple of comment back? (ShutterStock)

yep, ShutterStock suggest same pagination for desktop and mobile

but i like more my second example from pinterest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pagination This is the name of the generic UI component, not the React module! new feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants