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

Pasting labels sometimes adds a Div element that is not present in the source of the copy #2447

Open
BryanValverdeU opened this issue Feb 27, 2024 · 4 comments
Assignees

Comments

@BryanValverdeU
Copy link
Contributor

Describe the bug
Div is added under label on paste, should not happen

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'https://codepen.io/Bryanvalverdeu/pen/zYXOobZ
  2. copy content
  3. paste in ROosterJS Content model demo
  4. See that the label elements have a Div Wrapped causing the labels to have 2 lines

Expected behavior
Div should not be added

@JiuqingSong
Copy link
Collaborator

I think the problem is not adding DIV, but "display:flex", which is not supported in our code.

I feel this result is by design. Unless we want to support flex.

@BryanValverdeU
Copy link
Contributor Author

BryanValverdeU commented Mar 5, 2024

Not sure, in the source content, in the Label we do not have a div inside of the element:
image

Once it is pasted a div is appended to the label:
image

If I remove the inner Div in the label, the extra spacing is gone:
image

Do you feel this is by design or a fidelity issue?

@JiuqingSong
Copy link
Collaborator

  1. There is "display:flex" which is something we don't support.
  2. The HTML element "label" is not handled today. I think we can just treat it as a regular segment then this should be fixed

@JiuqingSong
Copy link
Collaborator

I tried to add label with knownElementProcessor, then no additional DIV is added:

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants