Toolbar doesn't display when it contains an inline equation
What’s broken?
Toolbar doesn't display when it contains an inline equation. Users can't align their text (one of the consequences)
What did you expect to happen?
Toolbar should display
Steps to reproduce
https://github.com/user-attachments/assets/2efa48f6-a02e-437f-8dc8-a08efbafc79b
BlockNote version
No response
Environment
No response
Additional context
Tested on this example https://www.blocknotejs.org/examples/custom-schema/math-block
Contribution
- [ ] I'd be interested in contributing a fix for this issue
Sponsor
- [x] I'm a sponsor and would appreciate if you could look into this sooner than later 💖
Hi @virgile-dev we did discuss this internally. The thing is that the formatting toolbar shows options like bold & italics too and there is not a way to bold or italic on math text. So, we disable showing the toolbar if it contains content which it cannot operate on. Do you think that it should show, but just not work when the user clicks on those buttons?
Hey @nperez0111 I think it should show the actions you can actually perform like
- change block type
- align
- indent
- comment
Just to make sure we are on the same page here, you'd prefer it to look like this:
I think it is reasonable, but. I could see it being confusing as well (not to say that the current situtation is not already confusing).
yeah that's what I had in mind
You could also display the other options as blocked (like greyed out), but might be even more confusing and it uses real estate to show something the user can't do. I'm not a fan.
I have a fix that keeps block actions available when a selection includes inline math, while hiding unsupported inline formatting and links. It passes regression tests in Chromium, Firefox and WebKit. Would you be open to paying $75 for the patch and tests?
Dima Mak / ub3dqy