Commit f67c919
authored
Write editor: caption is editable after reload (RSM-3359) (#48866)
Captions are saved as `<figcaption class="wp-element-caption">` and come
back from the server without `contentEditable`. The caption-button click
handler only set up an editable figcaption when one didn't already
exist, so reloaded posts had captions that were uneditable and left-
aligned (missing the `bw-figcaption` class that supplies `text-align:
center` and the placeholder).
Initialize any pre-existing figcaption at figure init time so it picks
up the same class, contentEditable, placeholder, and click-stop listener
as a freshly-created one.1 parent 225e7b9 commit f67c919
3 files changed
Lines changed: 25 additions & 2 deletions
File tree
- projects/packages/jetpack-mu-wpcom
- changelog
- src/features/write
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1224 | 1224 | | |
1225 | 1225 | | |
1226 | 1226 | | |
1227 | | - | |
1228 | | - | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
1229 | 1233 | | |
1230 | 1234 | | |
1231 | 1235 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1128 | 1128 | | |
1129 | 1129 | | |
1130 | 1130 | | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
1131 | 1146 | | |
1132 | 1147 | | |
1133 | 1148 | | |
| |||
0 commit comments