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

Rich Text: Non-selected inline boundaries wrongly highlighted #14120

Closed
aduth opened this issue Feb 26, 2019 · 1 comment · Fixed by #14411
Closed

Rich Text: Non-selected inline boundaries wrongly highlighted #14120

aduth opened this issue Feb 26, 2019 · 1 comment · Fixed by #14411
Assignees
Labels
[Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Package] Rich text /packages/rich-text

Comments

@aduth
Copy link
Member

aduth commented Feb 26, 2019

Describe the bug

When applying an inline format to a region of text, any other texts in the same paragraph with that same format appear as highlighted. I would only expect the selected text to be highlighted.

To Reproduce

Steps to reproduce the behavior:

  1. Navigate to Posts > Add New
  2. Insert a new paragraph block
  3. Insert some text
  4. Apply bold to a fragment of text
  5. Apply bold to an entirely separate fragment of text
  6. Observe that both fragments of text are highlighted

Expected behavior

Only the text selected at step 5 should appear as highlighted when bold is applied.

Screenshots

bolded

Desktop

  • OS: macOS Mojave Version 10.14.3
  • Browser: Chrome Version 72.0.3626.119 (Official Build) (64-bit)

Additional context

Gutenberg master (e0adbe0), 5.1.0 latest release.

cc @iseulde

@aduth aduth added [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Package] Rich text /packages/rich-text labels Feb 26, 2019
@ellatrix
Copy link
Member

This is a result of having the same reference at those indices after applying the format (and normalising formats). We should probably only normalise neighbouring formats only. This used to be the case before one of the list rewrites. I can look into this after #13948, when list formats are separated.

The highlighting of other boundaries will go away as soon as you move selection, because create uses a reference per DOM element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Package] Rich text /packages/rich-text
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants