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