Skip to content

Commit 42fe57c

Browse files
committed
fix: rich text editor fix
1 parent 95f4d69 commit 42fe57c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/demo/examples/simple/form-data.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"firstName": "Chuck",
33
"lastName": "Norris",
44
"age": 75,
5+
"bio": "<p><u>ads</u></p>",
56
"password": "noneed",
67
"creatableSelectTest": "[{\"label\":\"hello\",\"value\":\"hello\"},{\"label\":\"yes\",\"value\":\"yes\"}]",
78
"selectTest": "[{\"key\":\"220\",\"value\":\"Vanaf 6 jaar\",\"allowableOptionValues\":{\"210\":\"Alle Leeftijden\",\"220\":\"Vanaf 6 jaar\",\"225\":\"Vanaf 9 jaar\",\"230\":\"Vanaf 12 jaar\",\"240\":\"Vanaf 16 jaar\",\"250\":\"Vanaf 18 jaar\"}},{\"key\":\"210\",\"value\":\"Alle Leeftijden\",\"allowableOptionValues\":{\"210\":\"Alle Leeftijden\",\"220\":\"Vanaf 6 jaar\",\"225\":\"Vanaf 9 jaar\",\"230\":\"Vanaf 12 jaar\",\"240\":\"Vanaf 16 jaar\",\"250\":\"Vanaf 18 jaar\"}},{\"key\":\"225\",\"value\":\"Vanaf 9 jaar\",\"allowableOptionValues\":{\"210\":\"Alle Leeftijden\",\"220\":\"Vanaf 6 jaar\",\"225\":\"Vanaf 9 jaar\",\"230\":\"Vanaf 12 jaar\",\"240\":\"Vanaf 16 jaar\",\"250\":\"Vanaf 18 jaar\"}}]"

src/fields/components/lib/RichText.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const BLOCK_TAGS = {
4040
const MARK_TAGS = {
4141
strong: 'bold',
4242
em: 'italic',
43-
u: 'underline',
43+
u: 'underlined',
4444
s: 'strikethrough',
4545
code: 'code',
4646
};
@@ -337,6 +337,7 @@ class RichText extends React.Component {
337337

338338
if (['numbered-list', 'bulleted-list'].includes(type)) {
339339
const { value } = this.state;
340+
if (!value.blocks.size) return true;
340341
const parent = value.document.getParent(value.blocks.first().key);
341342
isActive = this.hasBlock('list-item') && parent && parent.type === type;
342343
}

0 commit comments

Comments
 (0)