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

onReplace: select the last block #13294

Merged
merged 3 commits into from
Feb 18, 2019
Merged

onReplace: select the last block #13294

merged 3 commits into from
Feb 18, 2019

Conversation

ellatrix
Copy link
Member

@ellatrix ellatrix commented Jan 11, 2019

Partly fixes #5317. Currently onReplace sets the block selection to the first block. This makes it so that onReplace sets it to the last block, so when you paste some blocks, the selection is set to the last block.

This seems to be a good default for onReplace in general, rather than selecting the first block.

I also tried setting initialPosition to -1, but that resulted in some failing tests for the quote block. Because it has two input fields, selection would be set to the cite field when creating a quote block through the /quote shortcut.

So this PR is not a complete fix, but it alleviates the issue.

@ellatrix ellatrix requested review from aduth and a team January 11, 2019 17:31
@ellatrix ellatrix added [Feature] Paste [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... labels Jan 11, 2019
@gziolo gziolo added this to the 5.1 (Gutenberg) milestone Feb 7, 2019
@ellatrix
Copy link
Member Author

I think this might still be a small but significant user XP improvement to add for the next release. I'll look at the tests shortly.

@ellatrix
Copy link
Member Author

Thank you @mcsf!

@ellatrix ellatrix merged commit d7aa66e into master Feb 18, 2019
@ellatrix ellatrix deleted the try/replace-select-last branch February 18, 2019 13:50
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* onReplace: select the last block

* Update tests

* Add second test to cover cases of REPLACE_BLOCKS
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* onReplace: select the last block

* Update tests

* Add second test to cover cases of REPLACE_BLOCKS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Paste [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pasting should bring you to end of content, not beginning
6 participants