9 Sep 2019 |
sharpertool | Thibaud - is this something you recognize?
> const initialContent = { entityMap: {}, blocks: [] }
> const initialEditorState = createEditorStateFromRaw(initialContent)
I get an error on the 2nd line: “TypeError: cannot read property ‘getKey’ of undefined”
This is nearly a cut-paste from your docs, so not sure what I’m missing. | 16:16:42 |
sharpertool | Looks like you need at least this:
>>> {
entityMap: {},
blocks: [{text: ‘’, type: ‘unstyled’}]})
} | 20:20:34 |
10 Sep 2019 |
| thp44 changed their profile picture. | 15:31:37 |
12 Sep 2019 |
Thibaud | sharpertool yep – there is a bug / implementation detail in the Draft.js conversion that means the content needs to at least have one block | 13:47:45 |
Thibaud | (edited) ... one block => ... one block in it | 13:47:46 |
Thibaud | The editor wouldn’t be usable anyway if it was initialised with "no blocks", but the way this fails is a bit annoying | 13:48:21 |
| mattwestcott changed their profile picture. | 15:18:06 |
| scotchester changed their profile picture. | 15:51:32 |
| sharpertool changed their profile picture. | 21:44:16 |
sharpertool | In reply to@_slack_wagtailcms_U0ME9SGR1:matrix.org The editor wouldn’t be usable anyway if it was initialised with "no blocks", but the way this fails is a bit annoying Well, maybe the example can be updated to represent the minimal required value | 21:44:27 |
| flipperpa changed their profile picture. | 23:21:24 |
13 Sep 2019 |
| tom changed their profile picture. | 05:10:38 |
| sonny changed their profile picture. | 08:27:32 |
| coenvanderkamp changed their profile picture. | 09:44:05 |
| Thibaud changed their profile picture. | 14:33:15 |
Thibaud | In reply to@_slack_wagtailcms_U9DQ4PP9R:matrix.org Well, maybe the example can be updated to represent the minimal required value can you show me which example this is from? | 14:33:17 |
18 Sep 2019 |
| Eric Sherman changed their profile picture. | 13:39:20 |
| Eric Sherman changed their profile picture. | 16:16:12 |
Eric Sherman | can you use the 'placeholder' prop in draftail in wagtail when declaring rich text blocks to set placeholder text for that block? | 16:16:12 |
| tom changed their profile picture. | 16:28:48 |
| mattwestcott changed their profile picture. | 20:56:45 |
19 Sep 2019 |
| Eric Sherman changed their profile picture. | 02:59:23 |
| sharpertool changed their profile picture. | 06:33:24 |
sharpertool | In reply to@_slack_wagtailcms_U0ME9SGR1:matrix.org can you show me which example this is from? Sorry for the late response, but it’s here
> https://www.draftail.org/docs/controlled-component#data-conversion-helpers | 06:33:25 |
| mattwestcott changed their profile picture. | 08:04:49 |
| loicteixeira changed their profile picture. | 08:44:36 |
| tom changed their profile picture. | 09:00:06 |
| Thibaud changed their profile picture. | 09:30:51 |
Thibaud | In reply to@_slack_wagtailcms_U9DQ4PP9R:matrix.org Sorry for the late response, but it’s here
> https://www.draftail.org/docs/controlled-component#data-conversion-helpers thank you, I’ll fix this now | 09:30:52 |
| flipperpa changed their profile picture. | 21:04:57 |