-
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
Media options are not automatically opened when inserting a media block from the slash inserter #37275
Comments
Dug into this a bit today, and this is what I have figured out to this point. The way we know to pop-up the media options menu is by checking if the gallery/image/etc. ("media") block was the
which calls wasBlockJustInserted:
This is using lastBlockInserted:
The thing to note here is that Simply adding a If I both persist the That's as far as I've gotten so far. To be clear, I'm not at all confident ^that^ is an actual fix because (1) updating the cc: @guarani - you were one of the reviewers on the original PR, I doubt you'll remember anything from that because it's been awhile, but wanted to ping you just in case any of this sounds familiar. |
Hi @mchowning, I'm curious what's the reason the slash inserter uses |
It might just be because, technically, the slash inserter is always replacing a paragraph block. I think it's worth considering whether we want these kinds of actions (i.e., automatically opening the media options) triggered in other instances where a block is "replaced". For example, if we transformed an empty gallery block into an empty image block, would we want th media options menu to automatically open? My initial reaction is yes, but I'm not sure there is an obvious/clearly-right answer either. |
I see, the slash inserter is always invoked from inside a paragraph block. It seems from what you're saying that the slash inserter is very similar to the block transform operation in that it essentially replaces blocks. By extension, if you made the media options appear when using the slash inserter, that might also make the options appear when using block transforms. Is that correct? Looking at the current behavior, the media options doesn't appear when transforming (e.g. an Image block to a Gallery block). From a UX perspective, making media options appear when transforming might be beneficial to the user. That said, I have a feeling you might run into #29672 on iOS if you change this and two bottom action sheets are shown one after the other. I don't remember why the |
This isn't urgent, so it feels like the best course of action may be to just wait until Joel has a chance to chime in since he has the most context. |
👋 @jd-alexander ! Wondering if you might have any thoughts on this ticket. I know it's been quite a while since you worked on this, so no worries if you don't remember anything about this. 🙂 |
Hi @mchowning Thanks for the ping. I am just seeing this because I am mainly using Github enterprise for Tumblr work. Your investigation here is spot on. The refactor to include
I am not sure how the slash inserter interfaces with
This check was added because there are multiple operations that can trigger
Good find. |
Sure, I hope I can provide further context regarding this issue. The idea behind the
In case we'd like to include this behavior when using the slash inserter, following a similar pattern using a source parameter might be complex. Unlike the
This would be an alternative but I understand that we'll make this behavior (i.e. automatically opening the media options picker) the default for all cases, right? I can't remember exactly why we didn't consider this option, but we could try going this way if there's no other route. In any case, I'd recommend checking first that this approach doesn't introduce any undesired side-effects. |
Description
When adding a media block from the inserter menu, the media options are automatically opened, however, this behavior is not being replicated when adding the blocks from the slash inserter.
The blocks that support this feature are:
NOTE: The embed block uses a similar mechanism to request the embed link, probably the same workaround to enable this feature could be applied to this block.
Step-by-step reproduction instructions
/
to display the slash inserter.Expected behaviour
Media options should be automatically opened when inserting a media block from both the inserter menu and slash inserter.
Actual behaviour
Media options are not automatically opened when inserter a media block from the slash inserter.
Screenshots or screen recording (optional)
open-media-options-slash-inserter.mp4
WordPress information
Device information
The text was updated successfully, but these errors were encountered: