BlockNote icon indicating copy to clipboard operation
BlockNote copied to clipboard

Toolbar doesn't display when it contains an inline equation

Open virgile-dev opened this issue 4 weeks ago • 5 comments

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 💖

virgile-dev avatar Nov 02 '26 13:11 virgile-dev

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?

nperez0111 avatar Nov 02 '26 13:11 nperez0111

Hey @nperez0111 I think it should show the actions you can actually perform like

  • change block type
  • align
  • indent
  • comment

virgile-dev avatar Nov 02 '26 16:11 virgile-dev

Just to make sure we are on the same page here, you'd prefer it to look like this:

Image

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).

nperez0111 avatar Nov 02 '26 17:11 nperez0111

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.

virgile-dev avatar Nov 02 '26 18:11 virgile-dev

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

ub3dqy avatar Nov 02 '26 22:11 ub3dqy