Fix table bubble menu inconsistent appearance
What does this MR do and why?
The table bubble menu in the rich text editor currently appears quite inconsistently, with the console revealing errors being thrown.
It turns out the component couldn't handle a situation where the selection lay entirely within a Text node. This MR fixes that.
References
No related issue, I just happened upon this while working on another branch and split the fix out.
Screenshots or screen recordings
In the before video, the bubble menu dropdown "v"-shaped chevron appears correctly if you click at one end of the text in a cell, but clicking within the text (between two letters) causes an error instead.
| Before | After |
|---|---|
How to set up and validate locally
- Check out the branch.
- Create a table in the rich-text editor in e.g. creating a new issue, or a new comment on one. You should be able to copy and paste this in:
| here's my | lovely table | yay! | |-----------|--------------|------| | hmmm | what's this? | errors? | | in my table?! | no way | oh deary me | - Check that the table "bubble menu" dropdown appears correctly when clicking into a cell in the middle of its text content:
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
