After playing with our rich-text field, I found quite a few bad and/or bothersome bugs/quircks.
This is a fairly long list.
It would probably be smart to migrate from nodes to marks and remove our custom Delete and Backspace handlers before tackling this, because I would expect some of these issues to just go away.
Can't clear See #1711
If there's text in a rich-string field and you empty it and tab away, it gets re-added
First character ends up as last
When a rich-string field is empty (or probably if there are 0 spans, but I can't test that due to ☝), when you type, after the first character, the cursor jumps to the beginning again. So, the first typed character ends up at the end.
Can't always use backspace if clicking in at end
- Add something at the end
- Click out (i.e. blur, but without using forward Tab 🙃)
- Click in at the end
- Backspace doesn't work
"Delete" deletes whole span
- Change the value (i.e. type something)
- Tab
- Reverse-tab
- Cursor jumps to beginning of field
- Push delete 💥 everything is gone (or maybe just the first span)
Tabbing in behaves differently than normal inputs
Tabbing into a rich-text field tends to put the cursor at the beginning of the field instead of selecting all the text like happens on a normal input.
An exception: if you tab out of a rich-text field and then reverse-tab back in, the cursor lands where it was before.
Other potential improvements
It's very distracting that the text is always underlined.
We also having horizontal spacing between spans, which would look weird if it was in the middle of a word and be redundant if the span edges line up with explicit word spacing.
Idea:
- Remove spacing
- Only underline spans that have extra/non-default props ("non-default", because every span/run has a ws, which is only interesting if it doesn't match the field's ws)
That would hopefully result in:
- Almost no underlines
- Still being able to distinguish between spans, because spans with props are probably rarely next to spans with different props
After playing with our rich-text field, I found quite a few bad and/or bothersome bugs/quircks.
This is a fairly long list.
It would probably be smart to migrate from nodes to marks and remove our custom
DeleteandBackspacehandlers before tackling this, because I would expect some of these issues to just go away.Can't clearSee #1711If there's text in a rich-string field and you empty it and tab away, it gets re-addedFirst character ends up as last
When a rich-string field is empty (or probably if there are 0 spans, but I can't test that due to ☝), when you type, after the first character, the cursor jumps to the beginning again. So, the first typed character ends up at the end.
Can't always use backspace if clicking in at end
"Delete" deletes whole span
Tabbing in behaves differently than normal inputs
Tabbing into a rich-text field tends to put the cursor at the beginning of the field instead of selecting all the text like happens on a normal input.
An exception: if you tab out of a rich-text field and then reverse-tab back in, the cursor lands where it was before.
Other potential improvements
It's very distracting that the text is always underlined.
We also having horizontal spacing between spans, which would look weird if it was in the middle of a word and be redundant if the span edges line up with explicit word spacing.
Idea:
That would hopefully result in: