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

Allow media within media & text block to be selected #1607

Closed
iamthomasbishop opened this issue Nov 21, 2019 · 3 comments
Closed

Allow media within media & text block to be selected #1607

iamthomasbishop opened this issue Nov 21, 2019 · 3 comments
Assignees
Labels
InnerBlocks Proposal [Type] Enhancement Improves a current area of the editor

Comments

@iamthomasbishop
Copy link
Contributor

It's confusing that you can't select the media part of the Media & Text block but you can select the other side's blocks. The result of this is that you don't get the associated controls and interactions that a "normal" image or video block would offer. In other words, I would expect the media side to act as InnerBlocks of the Media & Text block.

To Reproduce
Steps to reproduce the behavior:

  1. Select a Media & Text block with an image on one side and some text block on the other side
  2. Try tapping on the image part
  3. Notice nothing happens, the Media & Text block ("parent") remains selected
  4. Try selecting text on the other side
  5. Notice that this works as you'd expect it to (as a "child" of the Media & Text block)

Example

image

@hypest
Copy link
Contributor

hypest commented Feb 28, 2020

👋 @pinarol , can this one perhaps be moved to a GutenPages project?

@pinarol
Copy link
Contributor

pinarol commented Mar 8, 2020

👋 @pinarol , can this one perhaps be moved to a GutenPages project?

Yeah let's take care of this inside GutenPages. @hypest

@koke
Copy link
Member

koke commented Mar 9, 2020

I would expect the media side to act as InnerBlocks of the Media & Text block

That would be interesting, but I wouldn't try to fake it just for mobile. We can explore what it'd take to make media-text use inner blocks, but I think we might hit some limitations of the format. For the media part, we'd have two options:

  • Use a template lock to limit contents to one children, but then you can only lock it to either an image or a video block
  • Don't use a template lock and allow only image/video as the children, but then you can't limit it to one child only.

It would also seem interesting to explore how to implement cardinality constraints on InnerBlocks, so you can specify a maximum of 1 child. That could also help with the issues we were discussing around columns and the insert/remove behavior when the number of items is constrained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
InnerBlocks Proposal [Type] Enhancement Improves a current area of the editor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants