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

Try: Don't show a clone when dragging. #23024

Merged
merged 10 commits into from
Jun 25, 2020
10 changes: 7 additions & 3 deletions packages/components/src/draggable/style.scss
Original file line number Diff line number Diff line change
@@ -18,9 +18,13 @@ body.is-dragging-components-draggable {
z-index: z-index(".components-draggable__clone");
opacity: 0.7;

// Hide the actual clone. If this experiment is successful, we'll want to actually remove the clone entirely.
> * {
// This needs specificity as a theme is meant to define these by default.
margin-top: 0 !important;
margin-bottom: 0 !important;
display: none;
}
}

// This is only for testing.
.is-dragging.is-selected {
display: none !important;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you try with opacity: .5 instead here? Would work much better with for example reordering columns.

Copy link
Contributor Author

@jasmussen jasmussen Jun 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We tried with opacity: 0.7.

As I see it, there are two paths forward:

  1. Go with the more radical solution of pulling the block out of the flow, literally lifting it off the page. This benefits very big blocks which take up a lot of vertical space, but can cause jumpiness.
  2. Go with the opacity change, and the chip, which is still an improvement over what we're shipping, but does not have the space saving benefits.

Honestly I think we should get option 1 in good shape, try it in the plugin, and then go with option 2 if we find after using it that the jump is jarring.

}