Skip to content

Icon Block toolbar does not auto-present when inserted via slash command #76046

Closed as not planned

Description

@alansmodic

Description

When inserting the Icon Block using the slash command (/icon), the block toolbar does not automatically appear after insertion. The "Choose Icon" prompt is not visible, leaving the user with no clear next step. The toolbar only appears after clicking away and then clicking back into the block.

This is inconsistent with inserting the Icon Block via the left-hand block inserter sidebar, where the toolbar and "Choose Icon" prompt appear immediately upon insertion.

Step-by-step reproduction instructions

Steps to Reproduce:

Slash command (broken):

  1. Open a post or page in the editor
  2. Type /icon and select the Icon Block
  3. Observe: block inserts but toolbar does not appear

Block inserter sidebar (works correctly):

  1. Click the + inserter in the left sidebar
  2. Search for "Icon" and insert it
  3. Observe: toolbar appears immediately with "Choose Icon" visible

Expected Behavior:

  • The block toolbar should auto-present immediately after insertion regardless of insertion method, matching the sidebar insertion experience.

Actual Behavior:

  • Toolbar does not appear after slash command insertion. User must click away and click back into the block to reveal the toolbar.

Screenshots, screen recording, code snippet

Toolbar appearing:

Image

No toolbar after slash command:

Image

Environment info

Environment:

  • WordPress 7.0 Beta 2
  • Tested on WordPress Playground
  • Browser: Dia (Chromium-based)
  • Theme: Default WordPress Playground theme

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Activity

  1. added
    [Type] Bug
    on Mar 2, 2026
  2. alansmodic commented on Mar 2, 2026

    @alansmodic
    Author

    @ryanwelcher & @mcsf who worked on this for visibility.

    cc @annezazu

  3. Mustafabharmal commented on Mar 2, 2026

    @Mustafabharmal
    Contributor

    I'd like to work on this issue! I've identified the root cause: when a block is inserted via the slash command, the editor is in "typing" mode (isTyping = true). The BlockToolbarPopover has a ! isTyping render guard, so it stays hidden after slash insertion until something (mouse move, focus change) explicitly stops typing. The fix is to reset isTyping to false on REPLACE_BLOCKS in the store reducer. Sharing a PR shortly.

  4. added
    [Status] In Progress
    on Mar 2, 2026
  5. talldan commented on Mar 3, 2026

    @talldan
    Contributor

    This isn't specifically an issue with Icon, every block works the same. If you insert an image with the slash inserter the toolbar also doesn't show.

    Blocks don't usually have critical setup UI only in the toolbar, so that's what makes the Icon block different. Instead they placeholder controls in the canvas, which makes the process of updating the block much easier.

    I think this issue probably needs some design feedback before proceeding with a fix.

    User must click away and click back into the block to reveal the toolbar.

    Moving the mouse will reveal the toolbar, so no need to click away. Shift+Tab also does the same, moving focus into toolbar and revealing it visually.

  6. added
    Needs Design Feedback
    on Mar 3, 2026
  7. alansmodic commented on Mar 3, 2026

    @alansmodic
    Author

    Good point. At least with /image you get the options presented visually regardless of the toolbar (below). Something similar with /icon that simply said choose icon might be a good approach.

    Image
  8. mcsf commented on Mar 5, 2026

    @mcsf
    Contributor

    I agree with @talldan: this is a design problem, and changing the rules of writing flow and isTyping would be wrong.

    At least with /image you get the options presented visually regardless of the toolbar (below). Something similar with /icon that simply said choose icon might be a good approach.

    Early on in development the Icon block did have a placeholder, but through review we decided to simplify — cc @ryanwelcher and @jasmussen

    Given the time constraints we have with WP 7.0, let's be practical:

    • Would we be OK with shipping the block as it is now with this imperfection? Users using the slash completer would just have to move the cursor to see the toolbar. Personally, I'm more than OK with it.
    • Once the 7.0 dust settles, what — if any — solutions should we consider here?
  9. jasmussen commented on Mar 6, 2026

    @jasmussen
    Contributor

    Thank you for the ping! It's pretty critical that we do not change the existing placeholder to the same format that the default Image block placeholder uses, as the reason it is small is the same reason that is outlined in #64288, so we should not regress that. Icons are meant to be used small, and the gray buttonless placeholder allows you to insert a not-yet-chosen Icon in a pattern so users can simply "fill in the blanks".

    For the same reason, the Image block collapses into just the gray material when inserted in a narrow context:

    Image

    The issue is still valid, though: you insert with the slash command and you don't see the block toolbar. I think it's related to the isTyping function (I think it's called), which fades it out when you're writing to let you see the paragraph above the one you're writing:

    Image

    But as shown above, there are several triggers that show the toolbar again, one of them being if you move your cursor, or if you start selecting text (shift + arrowkeys). Is there another trigger we can add that shows the block toolbar? E.g. after inserting using the slash command, or perhaps just when selecting a non-text block using arrowkeys?

  10. talldan commented on Mar 6, 2026

    @talldan
    Contributor

    That's a good point about the image block. I hadn't noticed it does that when constrained to a smaller size.

    I'm curious why there's no interaction at all with the grey placeholder state? The image block for example doesn't seem to allow dragging and dropping images on top of the smaller placeholder or a click to add images.

    Featured Image is another block that works differently again, as that allows a click to open the media library and drag and drop.

    Is there another trigger we can add that shows the block toolbar? E.g. after inserting using the slash command, or perhaps just when selecting a non-text block using arrowkeys?

    #76054 essentially does this, and it seems to work ok in my previous testing.

  11. talldan commented on Mar 6, 2026

    @talldan
    Contributor

    Here's the three blocks compared all at 64px width:

    Featured Image
    (featured image centers itself and has fixed height of 200px, the placeholder receives clicks and drops)
    Image

    Image
    (image block stays aligned left, and has a fixed height of 64px when its width is less than 160px, the placeholder is not interactive)
    Image

    Icon
    (icon stays aligned left, has proportional width and height, and the placeholder is not interactive)
    Image

  12. jasmussen commented on Mar 6, 2026

    @jasmussen
    Contributor

    The image block for example doesn't seem to allow dragging and dropping images on top of the smaller placeholder or a click to add images.

    That's definitely a bug worth fixing. It should absolutely remain a drop-target.

    Featured image is different indeed, as is Site Logo. If these resonate, possibly that could provide a path forward, insofar as they include an upload button that opens the media library. Our smallest button is 24x24 and could barely fit. The reason I'm not convinced about those, however, is that I don't know how they would translate to the text-labels-only function, which still deserves loving refactor work and expansion:

    Image

    Nevertheless, the behaviors built into Featured Image and Site Logo were nascent attempts at solving this same issue, much more pressing because both of those block types are even more commonly used in very constrained contexts:

    Image

    The following is obviously an extreme provocation, but I share it to showcase why it's important to maintain this behavior for patterns:

    Image

    All that's mostly context, but for now, #76054 feels like a solid step forward.

  13. jasmussen commented on Aug 26, 2026

    @jasmussen
    Contributor

    Here's the latest state of things:

    Image

    Because the issue with the block toolbar not appearing upon insertion is relevant to every block, for the purposes of this PR I'm going to close it as not planned. However I'll move some conversation as well to #76054 to see if there's a useful path forward there, after all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Needs Design Feedback[Status] In Progress[Type] Bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions