-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: Responsive broken in 7.2.0 #2594
Comments
It looks like the dynamic inline styles are not being created... @media screen and (max-width: 960px)
<style>
.p-datatable[pr_id_2] .p-datatable-tbody > tr > td {
display: flex;
width: 100% !important;
align-items: center;
justify-content: space-between;
} |
Broken by #2448 |
I think the root issue is this change: this.setState({ attributeSelector: UniqueComponentId() }, () => {
this.el.setAttribute(this.state.attributeSelector, '');
});
if (this.props.responsiveLayout === 'stack' && !this.props.scrollable) {
this.createResponsiveStyle();
}
I tested the following change against the latest showcase running locally and it seems to address the chicken/egg situation by creating the responsive style in the this.setState({ attributeSelector: UniqueComponentId() }, () => {
this.el.setAttribute(this.state.attributeSelector, '');
if (this.props.responsiveLayout === 'stack' && !this.props.scrollable) {
this.createResponsiveStyle();
}
}); |
Nice analysis and fix! |
If you go to the Showcase Responsive demo in 7.1.0 it works properly when shrinking your browser. However in 7.2 all of the Responsive UI features seem broken.
https://www.primefaces.org/primereact-v7/#/datatable/responsive
You can see its not stacking and the whole site seems not to be respecting the media queries. This is happening in my local app too.
7.1.0 Correct
7.2.0 INCORRECT
The text was updated successfully, but these errors were encountered: