Skip to content

Commit

Permalink
Fix primefaces#4471: Column Resize fix for strict and non-strict mode
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Jul 6, 2023
1 parent 0ce2401 commit 072200b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/lib/carousel/Carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export const Carousel = React.memo(
}));

useMountEffect(() => {
if (elementRef.current && !attributeSelector.current) {
if (elementRef.current) {
attributeSelector.current = UniqueComponentId();
elementRef.current.setAttribute(attributeSelector.current, '');
}
Expand Down
10 changes: 5 additions & 5 deletions components/lib/datatable/DataTable.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from 'react';
import PrimeReact, { FilterMatchMode, FilterOperator, FilterService } from '../api/Api';
import { PrimeReactContext } from '../api/Api';
import PrimeReact, { FilterMatchMode, FilterOperator, FilterService, PrimeReactContext } from '../api/Api';
import { ColumnBase } from '../column/ColumnBase';
import { useEventListener, useMountEffect, useUnmountEffect, useUpdateEffect } from '../hooks/Hooks';
import { ArrowDownIcon } from '../icons/arrowdown';
Expand Down Expand Up @@ -1340,7 +1339,10 @@ export const DataTable = React.forwardRef((inProps, ref) => {
};

useMountEffect(() => {
attributeSelector.current = UniqueComponentId();
if (elementRef.current) {
attributeSelector.current = UniqueComponentId();
elementRef.current.setAttribute(attributeSelector.current, '');
}

//setFiltersState(cloneFilters(props.filters)); // Github #4248
setD_filtersState(cloneFilters(props.filters));
Expand All @@ -1355,8 +1357,6 @@ export const DataTable = React.forwardRef((inProps, ref) => {
});

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

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

0 comments on commit 072200b

Please sign in to comment.