GCTC-NTGC / gc-digital-talent

GC Digital Talent is the new recruitment platform for digital and tech jobs in the Government of Canada. // Talents numériques du GC est la nouvelle plateforme de recrutement pour les emplois numériques et technologiques au gouvernement du Canada.
https://talent.canada.ca
GNU Affero General Public License v3.0
22 stars 8 forks source link

🐛 Rich text has weird backspacing behaviour when inside of a list... maybe? #8602

Closed JoshBeveridge closed 9 months ago

JoshBeveridge commented 10 months ago

✨ Summary

@esizer and I looked at this for a bit to try and figure out if there's actually a bug present, but we couldn't figure it out, so we'd like to collect more opinions/testers. Essentially, when I was styling the RichText UI component for #8601, I noticed that when you're typing inside of a list, you can't backspace out of the list.

Eric gave this a test and didn't seem to have the same problem. We both tried in Storybook using Firefox on Windows 11. Essentially, I was expecting this to work like other text editing software such as MS Word, where if you backspace once, you clear the bullet, backspace twice to bring your cursor inline with the list, backspace a third time to bring your cursor OUT of the list, and the backspace a fourth time to return to the previous list item.

I've included videos of both the behaviour in MS Word, as well as what I was seeing in Storybook for comparison. We're mostly looking for people's thoughts on the behaviour and whether or not it behaves the same way for everyone.

Storybook recordingMS Word recording

Steps to reproduce

Expected outcome

Personally I would expect this to behave like other common software, but if others can exit the list without any issues, we can close this until it's brought up again.

### ✅ Requirements
- [ ] Experience the potential weirdness yourself
- [ ] Perhaps try another browser
petertgiles commented 10 months ago

I tried both Firefox and Chrome on Linux and had to use the menu button since the backspace wouldn't clear out of the list, like you. I think what's happening is that when you backspace on the line to clear the bullet then that line because part of the previous list item as a multi-line item. You can see that if you click the menu button when the cursor is on either line then both lines leave the list together.

That said, I'm not sure that our editor not behaving exactly like MS Word is a bug. Even if we do want to change this, can we even do that given that it's a library that we're using?

petertgiles commented 10 months ago

Yeah, you can see that it renders it as a multi-line item, too. image

petertgiles commented 9 months ago

No recent activity. Feel free to reopen if we decide on a direction and have a path forward.