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

fix a tiptap bug when a pasted text takes the style of the first configured text style element #4537

Closed
wants to merge 4 commits into from

Conversation

ETLaurent
Copy link
Contributor

@ETLaurent ETLaurent commented May 14, 2024

Summary

When pasting content from your clipboard to our rich text editor, tiptap goes through the process of forcing your paste into appropriate markup based on your RT config. This often ends with wrapping something in a span. If the RT config has a span without a class defined this will appear as expected, but if the config does not have a plain span the span will get converted to the first available span configuration, which can be an unexpected stylization.

Acceptance criteria

  • If a RT configuration has spans, ensure an unclassed span is added to the configuration.
  • Do not add this unclassed span style to the Inline Styles menu
  • Highlighting the unclassed span will not show classed spans as the active style. It will accurately reflect that the user has made no selection from the inline style menu.

What are the specific steps to test this change?

See ticket 5922

What kind of change does this PR introduce?

(Check at least one)

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build-related changes
  • Other

Make sure the PR fulfills these requirements:

  • It includes a) the existing issue ID being resolved, b) a convincing reason for adding this feature, or c) a clear description of the bug it resolves
  • The changelog is updated
  • Related documentation has been updated
  • Related tests have been updated

If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

@ETLaurent ETLaurent changed the title fix a tiptap bug when a pasted text takes the style of the first conf… fix a tiptap bug when a pasted text takes the style of the first configured text style element May 14, 2024
stuartromanek
stuartromanek previously approved these changes May 15, 2024
boutell
boutell previously approved these changes May 16, 2024
@boutell boutell dismissed stale reviews from stuartromanek and themself via dbd55bf May 16, 2024 18:06
@stuartromanek
Copy link
Member

we don't need this now, I believe the other fix to be better

@ETLaurent ETLaurent deleted the pro-5922-tiptap-bug branch May 20, 2024 11:41
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

Successfully merging this pull request may close these issues.

None yet

3 participants