Fix issue where block inserted in wrong place when selection is in nested block list, but root appender is used.#23668
Merged
Conversation
talldan
commented
Jul 3, 2020
|
|
||
| rootClientId = | ||
| rootClientId || | ||
| getBlockRootClientId( clientId || getBlockSelectionEnd() ) || |
Contributor
Author
There was a problem hiding this comment.
The issue was that rootClientId and clientId are undefined for the root appender, so this fallback to getBlockSelectionEnd would result in blocks being inserted in the wrong place (and potentially the wrong inserter items displayed).
|
Size Change: +1.79 kB (0%) Total Size: 1.13 MB
ℹ️ View Unchanged
|
Member
|
Would it be possible to add an e2e test? |
Contributor
Author
|
@ellatrix E2E tests now added. |
youknowriad
pushed a commit
that referenced
this pull request
Jul 13, 2020
…sted block list, but root appender is used. (#23668) * Remove use of getSelectionEnd to determine where blocks should be inserted * Add e2e tests
Contributor
|
@talldan Looks like this PR broke the global inserter in the widgets screen. I'm not sure what's the best path forward to avoid both issues in both places. |
Contributor
|
Fix here #24045 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #23263. This also seems to fix an issue where the trailing inserter is sometimes on the left and sometimes on the right.
When clicking the trailing root appender while selection is in an inner blocks list, the block will be inserted where selection is instead of at the root level.
I did some digging and it looks like the code was added in #22140 for the widgets screen, so this PR essentially reverted part of that. This change might break things there, but it's hard to tell what.
How has this been tested?
Screenshots
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: