Looking at the FloatingToolbarButtons component it appears to be expected that the floating toolbar is visible in Viewing mode showing only the CommentToolbarButton and MoreDropdownMenu, however the floating toolbar is not shown at all.
I've tried adjusting the floatingToolbarState to no avail:
ignoreReadOnly: true // Appears to hide the toolbar in both modes
hideToolbar: false // Appears to have no affect.
Even commenting out if (hidden) return null; in floating-toolbar doesn't allow it to render correctly.
The useFloatingToolbarState hook doesn't appear to be documented anywhere and the properties don't seem to behave as their names would suggest.
It seems the intention of the standard components is to allow comments when the editor is readOnly, this is very useful, but having only the main toolbar button to add a comment is a bit clunky. I'm struggling to find what's causing the floating toolbar to be hidden.
Oddly, clicking around to look at the state in react devtools seems to make it render intermittently, not sure what that means but maybe some kind of circular reference going on somewhere??
Reproduction URL
No response
Reproduction steps
1. Go to the playground
2. Click on mode dropdown and select "Viewing"
3. Highlighting any section of the editor value does not show the floating toolbar.
Plate version
37
Slate React version
0.109.0
Screenshots
No response
Logs
No response
Browsers
Chrome
Funding
You can sponsor this specific effort via a Polar.sh pledge below
We receive the pledge once the issue is completed & verified
Description
Looking at the FloatingToolbarButtons component it appears to be expected that the floating toolbar is visible in Viewing mode showing only the CommentToolbarButton and MoreDropdownMenu, however the floating toolbar is not shown at all.
I've tried adjusting the floatingToolbarState to no avail:
Even commenting out
if (hidden) return null;
in floating-toolbar doesn't allow it to render correctly.The useFloatingToolbarState hook doesn't appear to be documented anywhere and the properties don't seem to behave as their names would suggest.
It seems the intention of the standard components is to allow comments when the editor is readOnly, this is very useful, but having only the main toolbar button to add a comment is a bit clunky. I'm struggling to find what's causing the floating toolbar to be hidden.
Oddly, clicking around to look at the state in react devtools seems to make it render intermittently, not sure what that means but maybe some kind of circular reference going on somewhere??
Reproduction URL
No response
Reproduction steps
Plate version
37
Slate React version
0.109.0
Screenshots
No response
Logs
No response
Browsers
Chrome
Funding