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: Don't render drop zone bellow the default block appender #16119

Conversation

jorgefilipecosta
Copy link
Member

Description

Fixes: #9824

Currently, if we drag a block or a file above the default block appender we see the visual feedback that it is possible to drag it below the appender, we should not have that visual feedback.

I think we had some logic to handle the appender case. We added a flag isAppender = index === undefined; that would then add a class. But the index was never passed to the component and so the flag was always true. The CSS of the class was also not working as expected.

This PR fixes the isAppender flag/class computation and fixes the CSS to make sure when isAppender class is present only the top drop feedback border is visible.

How has this been tested?

I tried to drag & drop blocks and files in the editor and verified things still work as expected.
I created some paragraphs. I added an HTML block at the end, I noticed the default block appender appeared after the HTML block I tried to drop a file above the default block appender and I verified the visual drop feedback only appeared on the top of the default block appender.

@jorgefilipecosta jorgefilipecosta added [Type] Bug An existing feature does not function as intended [Feature] Drag and Drop Drag and drop functionality when working with blocks labels Jun 12, 2019
Copy link
Contributor

@draganescu draganescu left a comment

Choose a reason for hiding this comment

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

I have tested this and there results are:

  • on thi branch there is a visual indicator that appears below the last element when dragging images or blocks which is an improvement
  • however I dragged and dropped an image and it will not show up, although with the same post switched to master it works.

To replicate you should:

  • create a post
  • add three paragrapgs
  • drag and drop an image below the last paragraph
  • the image won't show

@jorgefilipecosta jorgefilipecosta force-pushed the fix/dont-render-dropzone-bellow-default-block-appender branch from a7dae32 to 359cc36 Compare August 6, 2019 15:01
@jorgefilipecosta
Copy link
Member Author

Hi @draganescu, thank you for your review! It seems the problem you found was not directly related to this code and after a rebase with master it stopped happening. Could you confirm if things work as expected now in your tests? Thank you in advance!

Copy link
Contributor

@draganescu draganescu left a comment

Choose a reason for hiding this comment

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

Everything works as described and I have no issues with the code.

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.

Do not allow dropping a block below the blank inserter
3 participants