Fix issues with drag and drop over text #9071
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
GIF of current behavior in
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.