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 issues with drag and drop over text #9071

Merged
merged 2 commits into from
Aug 17, 2018
Merged

Fix issues with drag and drop over text #9071

merged 2 commits into from
Aug 17, 2018

Conversation

jasmussen
Copy link
Contributor

This PR is a followup to #8752, and fixes #8115.

It is the situation in master right now that every single block has instructional overlay text when dragging files from the desktop over it. This also means very short paragraphs, separators, lots of different blocks that can neither fit the upload message, nor can really accept any uploads. That last part is key, because we also have a different upload indicator — the blue horizontal line. This indicator shows where the block you're about to drop will be inserted. Because you can drop an image file on top of a paragraph, but it will show up either before the paragraph, or after the paragraph, not inside it.

Therefore, the upload message should not be present on top of every single block. In fact it should be present only on placeholders and galleries, where dropping a file on the block itself really does insert the dropped file there.

GIF of behavior:

dragondrop

GIF of current behavior in master:

master

Note that this PR uses CSS to accomplish the above, which basically makes a whitelist of which blocks to show this message of. This doesn't seem ideal, and it also seems wasteful to include the actual text of the upload message even in paragraph blocks where they shouldn't be shown. @youknowriad any idea how to do this in a better way?

Basically the desired behavior is that for every block where the blue line shows up, we don't want the message, whereas for every block where the blue line doesn't show up, we want just the message.

This PR is a followup to #8752, and fixes #8115.

It is the situation in `master` right now that every single block has instructional overlay text when dragging files from the desktop over it. This also means very short paragraphs, separators, lots of different blocks that can neither fit the upload message, nor can really _accept_ any uploads. That last part is key, because we also have a different upload indicator — the blue horizontal line. This indicator shows _where the block you're about to drop will be inserted_. Because you can drop an image file on top of a paragraph, but it will show up either _before_ the paragraph, or _after_ the paragraph, not _inside_ it.

Therefore, the upload message should not be present on top of every single block. In fact it should be present only on placeholders and galleries, where dropping a file on the block itself really _does_ insert the dropped file there.
@jasmussen jasmussen added [Type] Bug An existing feature does not function as intended [Status] In Progress Tracking issues with work in progress labels Aug 17, 2018
@jasmussen jasmussen self-assigned this Aug 17, 2018
@jasmussen jasmussen requested review from karmatosed, youknowriad and a team August 17, 2018 07:57
@youknowriad
Copy link
Contributor

I'm pretty sure, I had something in the Code that differentiate between the blocks that need this text or not. I think it's based on the presence of Drop Handlers. I'll have to take a look at how it worked before the original PR to remember how this was achieved :)

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@youknowriad youknowriad removed the [Status] In Progress Tracking issues with work in progress label Aug 17, 2018
@youknowriad youknowriad added this to the 3.6 milestone Aug 17, 2018
@jasmussen
Copy link
Contributor Author

Lovely fix Riad, ship it!

@jasmussen jasmussen merged commit 1d09f2b into master Aug 17, 2018
@youknowriad youknowriad deleted the fix/dragondrop branch August 17, 2018 09:47
@oandregal oandregal added the [Feature] Drag and Drop Drag and drop functionality when working with blocks label Aug 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Drag and Drop Drag and drop functionality when working with blocks [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Block drop zone has no background color
3 participants