-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix: Don't render drop zone bellow the default block appender #16119
Conversation
There was a problem hiding this 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
a7dae32
to
359cc36
Compare
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! |
There was a problem hiding this 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.
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.