Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

wrong return value of getInlineStyleForCollapsedSelection and getInlineStyleForNonCollapsedSelection #3179

Open
psybor opened this issue Nov 7, 2022 · 0 comments

Comments

@psybor
Copy link

psybor commented Nov 7, 2022

Do you want to request a feature or report a bug?

bug.

What is the current behavior?

选中区域行内样式

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. You can use this jsfiddle to get started: https://jsfiddle.net/gmertk/e61z7nfa/.

https://draftjs.org/

  1. first line ends with bold.
  2. second line starts with italic.
  3. move to the start of second line, press enter. press up to move the cursor to the newly created line.
  4. input words.
    you can see it inherited the first line's bold.

What is the expected behavior?

image

When startOffset is 0, and startBlock.getLength() is 0, getInlineStyleForCollapsedSelection and getInlineStyleForNonCollapsedSelection should return empty OrderedSet() rather than lookUpwardForInlineStyle;

Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js?

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

No branches or pull requests

1 participant