Skip to content

Commit

Permalink
Fix primefaces#4211: Datatable attribute selector use Ref not state
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed May 17, 2023
1 parent ee105a5 commit ee7732e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions components/lib/datatable/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1333,12 +1333,10 @@ export const DataTable = React.forwardRef((inProps, ref) => {
});

useUpdateEffect(() => {
if (attributeSelector.current) {
elementRef.current.setAttribute(attributeSelector.current, '');
elementRef.current.setAttribute(attributeSelector.current, '');

if (props.responsiveLayout === 'stack' && !props.scrollable) {
createResponsiveStyle();
}
if (props.responsiveLayout === 'stack' && !props.scrollable) {
createResponsiveStyle();
}

return () => {
Expand Down

0 comments on commit ee7732e

Please sign in to comment.