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


Copy link

commented Jun 12, 2019


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.

Copy link

left a comment

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 Aug 6, 2019


This comment has been minimized.

Copy link
Member Author

commented Aug 6, 2019

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

left a comment

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

@jorgefilipecosta jorgefilipecosta merged commit 07d99a7 into master Aug 8, 2019

1 of 4 checks passed

Filter opened Filter opened
Filter opened Filter opened
Milestone It Milestone It
Travis CI - Pull Request Build Passed

@jorgefilipecosta jorgefilipecosta deleted the fix/dont-render-dropzone-bellow-default-block-appender branch Aug 8, 2019

@youknowriad youknowriad added this to the Gutenberg 6.3 milestone Aug 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.