-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add new selector getLastInsertedBlockClientId #46531
Conversation
Size Change: +31 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
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.
LGTM
Hey folks, is this something you plan to use in a PR or something, it's hard to judge of the usefulness of a new stable API without context. I don't see it used on the linked PR |
If you look at the "future plans" part of that PR, it should explain the reasoning. I'm going to try to implement that... |
Followup PR here: #46744 |
@youknowriad This was an oversight on my part. I believe it should have been experimental to start with. This has now been proven by the need to raise this PR which I'd very much appreciate your review on. |
What?
Adds a new selector for retrieving the
clientId
of the last inserted block.Why?
Some implementations do not select the block following insertion. Indeed this eventuality is catered for by the 4th argument of
insertBlocks
.Therefore it is important to have some means of programmatically retriving the ID of the last block that was inserted.
A case in point is the work being undertaken in the Nav block offcanvas experiment where we do not wish to immediately select a block that has been inserted as that would cause the inspector controls to switch away from those of the Navigation block which is where the offcanvas is rendered.
See #46503
How?
Adds selector and tests. Luckily the actions and reducer were already part of the code.
Testing Instructions
Run tests with
Testing Instructions for Keyboard
Screenshots or screencast