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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataTable: responsiveLayout="stack" and scrollable not working together #3693

Closed
rschyboll opened this issue Nov 23, 2022 · 10 comments
Closed
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add

Comments

@rschyboll
Copy link
Contributor

Describe the bug

The DataTable component does not change to stack layout, after the window width reaches it's breakpoint, if the scrollable property is set to true, even if the responsiveLayout property is set explicitly to stack.

Reproducer

https://codesandbox.io/s/xenodochial-joliot-oh2wun?file=/src/demo/DataTableResponsiveDemo.js

PrimeReact version

8.7.2

React version

18.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

Chrome 90

Steps to reproduce the behavior

  1. Set the responsiveLayout property to stack.
  2. Set the scrollable property to true.
  3. Set the breakpoint value to some expected width.
  4. Change the window size to lower than the breakpoint.

Expected behavior

I think that the datatable should still respect the responsiveLayout property, even if the scrollable property is set to true. The table should change it's layout from scroll, to stack, if the window is smaller than the breakpoint.

@rschyboll rschyboll added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 23, 2022
@melloware
Copy link
Member

Related to: #2479

@ghost
Copy link

ghost commented Dec 27, 2022

@melloware any progress on that? i'm having this issue as well and its a key functionality for my data-tables

@melloware
Copy link
Member

I will see if I can look at it over the next couple of days. I think this is a valuable feature.

@melloware melloware added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 28, 2022
@melloware melloware self-assigned this Dec 28, 2022
@melloware melloware added this to the 8.7.4 milestone Dec 28, 2022
melloware added a commit to melloware/primereact that referenced this issue Dec 28, 2022
@melloware
Copy link
Member

I put together a PR and I tested it and it works perfectly. IT dynamically switches the scrollable state based on the breakpoint value if using responsiveLayout="stack"

@rschyboll
Copy link
Contributor Author

I performed a quick test and it appears to be working. I am looking forward to it being merged.

@melloware
Copy link
Member

Thanks for testing!

@mertsincan mertsincan modified the milestones: 8.7.4, 10.0.0 Jan 26, 2023
@mertsincan
Copy link
Member

Hi all,

Due to technical limitations, stack mode is deprecated in the new version. Please use responsiveLayout="scroll". #4078

Best Regards,

@melloware melloware removed this from the 10.0.0 milestone Feb 22, 2023
@melloware
Copy link
Member

@mertsincan i think a lot of people use Stack for responsive tables!

@melloware melloware removed their assignment Feb 22, 2023
@franmc01
Copy link
Contributor

Why does the stack mode not appear in the documentation?

Friends do not go to make the little house to remove this responsive mode, one of my products uses this mode because first of all it is quite accessible and the information is super clean. I was going to upgrade to the latest version of the library but I cannot do it anymore :(

@Exodiel
Copy link

Exodiel commented Mar 22, 2023

Please reconsider this issue, its posible work with stack mode just using a simple media query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants