Make global inserter always visible & Fix a Global inserter bug#22115
Make global inserter always visible & Fix a Global inserter bug#22115jorgefilipecosta merged 2 commits intomasterfrom
Conversation
|
Size Change: +32 B (0%) Total Size: 1.12 MB
ℹ️ View Unchanged
|
3d5371c to
4c2bc98
Compare
4c2bc98 to
fa66dff
Compare
| select( 'core/edit-post' ).getEditorMode() === 'visual' && | ||
| select( 'core/editor' ).getEditorSettings().richEditingEnabled, | ||
| isInserterVisible: select( 'core/block-editor' ).hasInserterItems(), | ||
| isInserterVisible: hasInserterItems( |
There was a problem hiding this comment.
Right now we can "disable" or "hide" the inserter, I wonder if we should just one technique in all cases (disable it) to avoid "jumps"
There was a problem hiding this comment.
So essentially you are suggesting a refactor that makes the inserter always visible, although sometimes it can be disabled?
I think it would be a positive change and the UX would be better because the position of the other buttons would not move around and we would be consistent with what happens in other buttons e.g: undo.
There was a problem hiding this comment.
yes, something like that.
fa66dff to
263eec7
Compare
|
Hi @youknowriad this PR was updated and now makes the global inserter always visible. |
|
|
||
| <!-- wp:columns --> | ||
| <div class=\\"wp-block-columns\\"></div> | ||
| <!-- /wp:columns -->" |
There was a problem hiding this comment.
Not sure I understand why the snapshots change since you add a new test?
There was a problem hiding this comment.
I added a columns block to the default template so I can test a CPT locked all with a block without locking. The existing snapshots need to be updated to contain the added columns block.
263eec7 to
8245ee8
Compare
Description
The global inserter never appears if inserting at the root level is not possible. Inserting at the root level may not be possible, while inserting inside a specific block may be possible e.g: if we have CPT with locking all and the columns block inside.
This PR addresses the issue and makes sure the global inserter appears if it is possible to insert a block in the current position where it will be inserted.
How has this been tested?
I added an end to end tests and verified it passes.