Draft-js: Incorrect behavior in ordered lists

Created on 13 Mar 2019  路  3Comments  路  Source: facebook/draft-js

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

What is the current behavior?
Ordered lists do not preserve count when interrupted by an unordered list

You can repro it in any draft playground

  1. Create an ordered list item, type something in
  2. Hit enter, go to a new line - see the list is continuing.
  3. Now, switch the type of the current item to unordered list and hit tab to make it nested.
  4. Go to a new line and create a new ordered list item.

Expectation: list continues from 2.
Reality: list starts with 1. again

Screen Shot 2019-03-13 at 2 25 27 PM

What is the expected behavior?
List continues from 2.
Screen Shot 2019-03-13 at 2 31 44 PM

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

v0-11-beta

All 3 comments

Seems somewhat similar to the existing issue https://github.com/facebook/draft-js/issues/1903 ?

Yes, this is the same issue as #1903, and also #1392.

Hi @alina7091, thanks for reporting the issue. This bug is already fixed in master as you can see for yourself on the live demo on https://draftjs.org

In order to use a version of Draft.js that contains the fix, please add draft-js@next to your dependencies instead of 0.10.5. Please let us know if there are any issues with that version.

If you're curious, the tag @next currently points to the 0.11.0-beta2 version. If no major issues are reported by users, we'll publish it as @latest in a few weeks. We're not publishing a new version directly because there hasn't been a release since 0.10.5 in nearly two years, and we may break dependent projects. This way, we can let you test the new version and fix any issues you may find.

Was this page helpful?
0 / 5 - 0 ratings