Skip to content

Commit

Permalink
feat: delete grid item animation (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoncool authored Oct 16, 2023
1 parent 815fff7 commit b76b221
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 21 deletions.
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

0 comments on commit b76b221

Please sign in to comment.