Skip to content

Commit

Permalink
Refactor #4050
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Feb 14, 2023
1 parent f625ce2 commit 270888f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 6 additions & 4 deletions components/lib/orderlist/OrderList.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,19 @@ export const OrderList = React.memo(
}));

useMountEffect(() => {
setAttributeSelectorState(UniqueComponentId());
!attributeSelectorState && setAttributeSelectorState(UniqueComponentId());
});

useUpdateEffect(() => {
elementRef.current.setAttribute(attributeSelectorState, '');
createStyle();
if (attributeSelectorState) {
elementRef.current.setAttribute(attributeSelectorState, '');
createStyle();
}

return () => {
destroyStyle();
};
}, [attributeSelectorState]);
}, [attributeSelectorState, props.breakpoint]);

useUpdateEffect(() => {
if (reorderDirection.current) {
Expand Down
8 changes: 5 additions & 3 deletions components/lib/picklist/PickList.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,14 @@ export const PickList = React.memo(
}));

useMountEffect(() => {
setAttributeSelectorState(UniqueComponentId());
!attributeSelectorState && setAttributeSelectorState(UniqueComponentId());
});

useUpdateEffect(() => {
elementRef.current.setAttribute(attributeSelectorState, '');
createStyle();
if (attributeSelectorState) {
elementRef.current.setAttribute(attributeSelectorState, '');
createStyle();
}

return () => {
destroyStyle();
Expand Down

0 comments on commit 270888f

Please sign in to comment.