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

Fix drag shadow not visible when dragging a file on a narrow screen #7527

Conversation

danxuliu
Copy link
Member

When a file from the file list is dragged a drag shadow (a copy of the file row that follows the cursor position) is created. The drag shadow element is created as a direct child of the body element, so it needs a higher z-index than the one used for the file list to be visible.

In wide screens there is no problem, but in narrow screens the #app-content uses a z-index of 1000 in order to be visible over the #navigation-bar when they overlap, so the z-index of the drag shadow must be at least 1000 to be visible over the file list.

Instead of updating the hardcoded z-index it was removed and replaced by CSS rules for .dragshadow elements to ease theming.

Before:
files-drag-shadow-before

After:
files-drag-shadow-after

If you test this note that there are other issues when dragging files: it is not supported on touch screens, it triggers a slide of the navigation bar on narrow screens and the file could be dragged endlessly to the right. Those issues will be fixed in other pull requests.

When a file from the file list is dragged a drag shadow (a copy of the
file row that follows the cursor position) is created. The drag shadow
element is created as a direct child of the body element, so it needs a
higher "z-index" than the one used for the file list to be visible.

In narrow screens the "#app-content" uses a "z-index" of 1000 in order
to be visible over the "#navigation-bar" when they overlap, so the
"z-index" of the drag shadow must be at least 1000 to be visible over
the file list.

Instead of updating the hardcoded "z-index" it was removed and replaced
by CSS rules for ".dragshadow" elements to ease theming.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@danxuliu danxuliu added this to the Nextcloud 13 milestone Dec 15, 2017
@jancborchardt
Copy link
Member

@danxuliu for design-related things please always cc the whole @nextcloud/designers group :)

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

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

Tested and works 👍

@MorrisJobke MorrisJobke merged commit 19ffdec into master Dec 15, 2017
@MorrisJobke MorrisJobke deleted the fix-drag-shadow-not-visible-when-dragging-a-file-on-a-narrow-screen branch December 15, 2017 12:52
@MorrisJobke MorrisJobke mentioned this pull request Jan 2, 2018
30 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants