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

feat: removed grid item animation #91

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/components/DashKit/DashKit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ interface DashKitDefaultProps {
settings: SettingsProps;
context: ContextProps;
noOverlay: boolean;
// it will be deleted soon
_experimentDisableItemAnimation: boolean;
}

export interface DashKitProps extends DashKitGeneralProps, Partial<DashKitDefaultProps> {}
Expand All @@ -56,7 +54,6 @@ export class DashKit extends React.PureComponent<DashKitInnerProps> {
},
context: {},
noOverlay: false,
_experimentDisableItemAnimation: false,
};

static registerPlugins(...plugins: Plugin[]) {
Expand Down
3 changes: 1 addition & 2 deletions src/components/GridItem/GridItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class GridItem extends React.PureComponent {
noOverlay,
withCustomHandle,
} = this.props;
const {editMode, _experimentDisableItemAnimation} = this.context;
const {editMode} = this.context;
const width = Number.parseInt(style.width, 10);
const height = Number.parseInt(style.height, 10);
const transform = style.transform;
Expand All @@ -93,7 +93,6 @@ class GridItem extends React.PureComponent {
{
'is-dragging': isDragging,
'with-custom-handle': withCustomHandle,
'disable-animation': _experimentDisableItemAnimation,
},
preparedClassName,
)}
Expand Down
14 changes: 0 additions & 14 deletions src/components/GridItem/GridItem.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
.dashkit-grid-item {
position: relative;

&_is-dragging {
// https://github.com/STRML/react-grid-layout/issues/221#issuecomment-519844166
//user-select: none;
}

&__overlay {
position: absolute;
top: 0;
Expand Down Expand Up @@ -38,15 +33,6 @@
transition: height 200ms ease;
}

.react-grid-item {
transition: all 200ms ease;
transition-property: left, top;

&.dashkit-grid-item_disable-animation {
transition: none;
}
}

.react-grid-item.cssTransforms {
transition-property: transform;
}
Expand Down
2 changes: 0 additions & 2 deletions src/hocs/withContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ function useMemoStateContext(props) {
revertToOriginalLayout,
forwardedMetaRef: props.forwardedMetaRef,
draggableHandleClassName: props.draggableHandleClassName,
_experimentDisableItemAnimation: props._experimentDisableItemAnimation,
}),
[
resultLayout,
Expand All @@ -221,7 +220,6 @@ function useMemoStateContext(props) {
revertToOriginalLayout,
props.forwardedMetaRef,
props.draggableHandleClassName,
props._experimentDisableItemAnimation,
],
);
}
Expand Down