From a7bf79235120ac3fcda1d087a3e67eb183177bbb Mon Sep 17 00:00:00 2001 From: adarleyjrr <50996706+adarleyjrr@users.noreply.github.com> Date: Wed, 4 Jan 2023 16:04:26 -0500 Subject: [PATCH] fix: for bug that would cause rich text input to incorrectly render nested ordered/unordered lists --- CHANGELOG.md | 3 +++ src/components/WYSIWYGInput/draft.css | 19 +++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 431a4c3..8739387 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed a bug that would cause `WYSIWYGInput` component to incorrectly render nested ordered/unordered lists +- Tweaked default list style classes from `draft-js` to conform with list styles from class `pui-prose` + ## [9.2.3] 2022-12-15 ### Fixed diff --git a/src/components/WYSIWYGInput/draft.css b/src/components/WYSIWYGInput/draft.css index 5d83958..ba1c86e 100644 --- a/src/components/WYSIWYGInput/draft.css +++ b/src/components/WYSIWYGInput/draft.css @@ -98,7 +98,7 @@ text-align: right; } -/* .public-DraftStyleDefault-listLTR { +.public-DraftStyleDefault-listLTR { direction: ltr; } @@ -108,7 +108,7 @@ .public-DraftStyleDefault-ol, .public-DraftStyleDefault-ul { margin: 16px 0; - padding: 0; + padding: 0 !important; } .public-DraftStyleDefault-depth0 { @@ -183,6 +183,7 @@ position: absolute; text-align: right; width: 30px; + font-weight: initial; } &.public-DraftStyleDefault-listRTL:before { @@ -190,31 +191,37 @@ right: -36px; text-align: left; width: 30px; + font-weight: initial; } &:before { content: counter(ol0) ". "; counter-increment: ol0; + font-weight: initial; } &.public-DraftStyleDefault-depth1:before { - content: counter(ol1, lower-alpha) ". "; + content: counter(ol1, initial) ". "; counter-increment: ol1; + font-weight: initial; } &.public-DraftStyleDefault-depth2:before { - content: counter(ol2, lower-roman) ". "; + content: counter(ol2, initial) ". "; counter-increment: ol2; + font-weight: initial; } &.public-DraftStyleDefault-depth3:before { content: counter(ol3) ". "; counter-increment: ol3; + font-weight: initial; } &.public-DraftStyleDefault-depth4:before { - content: counter(ol4, lower-alpha) ". "; + content: counter(ol4, initial) ". "; counter-increment: ol4; + font-weight: initial; } } @@ -237,4 +244,4 @@ .public-DraftStyleDefault-depth4.public-DraftStyleDefault-reset { counter-reset: ol4; } - */ +