Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "re-adding animation for drag-n-drop to reorder columns",
"type": "patch"
}
],
"packageName": "office-ui-fabric-react",
"email": "[email protected]"
}
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,20 @@ export class DetailsColumnBase extends BaseComponent<IDetailsColumnProps> {
if (this.props.isDropped) {
if (this._root!.current!) {
this._root!.current!.classList!.add(classNames.borderAfterDropping);

this._async.setTimeout(() => {
if (this._root!.current!) {
this._root!.current!.classList!.add(classNames.noBorderAfterDropping);
}
}, 20);
}

this._async.setTimeout(() => {
if (this._root!.current!) {
this._root!.current!.classList!.remove(classNames.borderAfterDropping);
this._root!.current!.classList!.remove(classNames.noBorderAfterDropping);
}
}, 1500);
}, 1520);
}
}

Expand Down Expand Up @@ -245,6 +253,11 @@ export class DetailsColumnBase extends BaseComponent<IDetailsColumnProps> {
if (itemIndex) {
this._updateHeaderDragInfo(itemIndex);
this._root.current.classList.add(classNames.borderWhileDragging);
this._async.setTimeout(() => {
if (this._root!.current!) {
this._root!.current!.classList!.add(classNames.noBorderWhileDragging);
}
}, 20);
}
}

Expand All @@ -254,6 +267,7 @@ export class DetailsColumnBase extends BaseComponent<IDetailsColumnProps> {
this._updateHeaderDragInfo(-1, event);
}
this._root.current.classList.remove(classNames.borderWhileDragging);
this._root.current.classList.remove(classNames.noBorderWhileDragging);
}

private _updateHeaderDragInfo(itemIndex: number, event?: MouseEvent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,20 @@ export const getStyles = (props: IDetailsColumnStyleProps): IDetailsColumnStyles
paddingLeft: 8
};

const borderWhileDragging: IStyle = [
{
borderStyle: 'solid',
borderWidth: 1,
borderColor: palette.themePrimary
}
];

const borderAfterDragOrDrop: IStyle = [
{
borderColor: 'transparent'
}
];

return {
root: [
getCellStyles(props),
Expand Down Expand Up @@ -179,26 +193,12 @@ export const getStyles = (props: IDetailsColumnStyleProps): IDetailsColumnStyles

accessibleLabel: [hiddenContentStyle],

borderAfterDropping: [
{
borderStyle: 'solid',
borderWidth: 1,
borderColor: palette.themePrimary,
left: -1,
lineHeight: 31
}
],
borderWhileDragging: borderWhileDragging,

borderWhileDragging: [
{
selectors: {
'.ms-DetailsHeader &.ms-DetailsHeader-cell': {
borderStyle: 'solid',
borderWidth: 1,
borderColor: palette.themePrimary
}
}
}
]
noBorderWhileDragging: [borderAfterDragOrDrop, { transition: 'border-color 0.2s ease' }],

borderAfterDropping: [borderWhileDragging, { left: -1, lineHeight: 31 }],

noBorderAfterDropping: [borderAfterDragOrDrop, { transition: 'border-color 1.5s ease' }]
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,7 @@ export interface IDetailsColumnStyles {
sortIcon: IStyle;
filterChevron: IStyle;
borderAfterDropping: IStyle;
noBorderAfterDropping: IStyle;
borderWhileDragging: IStyle;
noBorderWhileDragging: IStyle;
}