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

InnerBlocks shows inline-image block, when not allowed #11621

Closed
hwinne opened this issue Nov 8, 2018 · 5 comments
Closed

InnerBlocks shows inline-image block, when not allowed #11621

hwinne opened this issue Nov 8, 2018 · 5 comments
Labels
Needs Technical Feedback Needs testing from a developer perspective. [Type] Help Request Help with setup, implementation, or "How do I?" questions.

Comments

@hwinne
Copy link

hwinne commented Nov 8, 2018

Describe the bug
When a new block is inserted with the 'InnerBlock' component, and 'allowedBlocks' is used, the 'Inline-Image' block still shows, even when it's not allowed.

To Reproduce
Steps to reproduce the behaviour:

  1. Go to the Gutenberg text-editor
  2. Add a block which uses InnerBlocks (with specific blocks inside)
  3. Add an InnerBlock
  4. You can now see 'inline-image', even if it should not appear.
  5. Save the post and reload the page, now the 'inline-image' option is gone.

Expected behaviour
The 'allowedBlocks' should appear, but if 'inline-image' is not allowed, it should not appear.

Screenshots
Before saving the post:
screenshot 2018-11-08 at 11 07 33

After saving the post and reloading the page:
screenshot 2018-11-08 at 11 07 57

Desktop (please complete the following information):

  • OS: MacOS Mojave
  • Browser: Chrome
  • Version: Chrome version 70.0.3538.77 (Official Build) (64-bit)

Additional context
Gutenberg 4.2.0

@hwinne hwinne changed the title Inline-Blocks shows inline-image block, when not allowed Inner-Blocks shows inline-image block, when not allowed Nov 8, 2018
@hwinne hwinne changed the title Inner-Blocks shows inline-image block, when not allowed InnerBlocks shows inline-image block, when not allowed Nov 8, 2018
@designsimply designsimply added the Needs Testing Needs further testing to be confirmed. label Nov 8, 2018
@designsimply
Copy link
Member

(Out of curiosity) how do you know when the inline images are and aren't supposed to appear. Is that something you see by reading the code or that you know from elsewhere? (Note: I don't know how to look that up in the code but would like to learn!)

@designsimply
Copy link
Member

I tested using the Media & Text block with WordPress 4.9.8 and Gutenberg 4.3 using Firefox 63.0.1 on macOS 10.13.6 and found that I was able to insert an inline image into an inner block (10s), however, now I am thinking that the following means that you are using custom code:

When a new block is inserted with the 'InnerBlock' component, and 'allowedBlocks' is used

Are you able to provide a code example for how you've used allowedBlocks in your case?

@designsimply designsimply added [Status] Needs More Info Follow-up required in order to be actionable. and removed Needs Testing Needs further testing to be confirmed. labels Nov 12, 2018
@hwinne
Copy link
Author

hwinne commented Nov 14, 2018

Yes it's when I build a custom block with InnerBlocks. I use allowedBlocks inside the edit function: <InnerBlocks allowedBlocks={ [ 'core/paragraph' ] }/> .
But when I use the insert block function it will also show the inline-image block:
screenshot 2018-11-14 at 16 00 27

This is only the first time when I insert the block. When I save the post and reload the page, the inline-image is gone:
screenshot 2018-11-14 at 16 03 07

@designsimply designsimply added [Type] Help Request Help with setup, implementation, or "How do I?" questions. Needs Technical Feedback Needs testing from a developer perspective. and removed [Status] Needs More Info Follow-up required in order to be actionable. labels Nov 30, 2018
@designsimply
Copy link
Member

Thanks for the reply. If you are able to provide a code example and tell me exactly where to place it (or maybe make a very small plugin that includes your custom block that can be installed for testing?), then I can help test. Otherwise, I've added the Needs Technical Feedback label and we can wait for a reply from someone with more developer experience to offer help.

@hwinne
Copy link
Author

hwinne commented Dec 6, 2018

I am not able to reproduce this issue on the current version of Gutenberg. So it seems fixed, as I have not seen other people having this issue. Therefore I will close this issue, thanks for your help anyway!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Technical Feedback Needs testing from a developer perspective. [Type] Help Request Help with setup, implementation, or "How do I?" questions.
Projects
None yet
Development

No branches or pull requests

2 participants