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

Metadata attribute is not preserved after transforming paragraph block into heading #59086

Closed
SantosGuillamot opened this issue Feb 15, 2024 · 2 comments · Fixed by #59179
Closed
Assignees
Labels
[Feature] Block API API that allows to express the block paradigm. [Feature] Block Transforms Block transforms from one block to another [Type] Bug An existing feature does not function as intended

Comments

@SantosGuillamot
Copy link
Contributor

What?

It seems that when transforming a block the metadata attribute is not preserved. For example, if I name a paragraph block with a custom name, it disappears after transforming it into a heading. Or if it has some bindings.

It seems it works fine with other attributes.

Is this expected? If not, any idea how it could be solved?

Reproduce

  1. Add a paragraph to a post.
  2. Rename the block to "Custom name".
  3. Transform the paragraph block into a heading block.
  4. Check that the "Custom name" has dissapeared.
@SantosGuillamot SantosGuillamot added the [Type] Bug An existing feature does not function as intended label Feb 15, 2024
@gziolo
Copy link
Member

gziolo commented Feb 15, 2024

@ntsekouras, who would be the best person to explore the best way to generalize handling for metadata attributes. I’m wondering if that’s a bigger task that also impacts Global Styles and other settings dynamically injected with hooks in the block editor. At the same time, maybe it’s expected to retain only the content.

@jordesign jordesign added the [Feature] Blocks Overall functionality of blocks label Feb 16, 2024
@talldan
Copy link
Contributor

talldan commented Feb 16, 2024

I also made an issue for this - Block renaming: retain name when transforming to a different block

I'll close that one though seeing as the discussion is starting here.

@gziolo gziolo added [Feature] Block API API that allows to express the block paradigm. [Feature] Block Transforms Block transforms from one block to another and removed [Feature] Blocks Overall functionality of blocks labels Feb 16, 2024
@SantosGuillamot SantosGuillamot changed the title Metadata attribute is not preserved after transforming a block Metadata attribute is not preserved after transforming paragraph block into heading Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. [Feature] Block Transforms Block transforms from one block to another [Type] Bug An existing feature does not function as intended
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants