Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/diagram-block
@blocknote/mantine
@blocknote/math-block
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
@blocknote/xl-typst-exporter
commit: |
|
Closes #3079. This is an alternative to #3095.
Problem
The label of a remote cursor was cut off:
Solution
The label is
position: fixed, so a scroll container does not clip it. CSS anchor positioning attaches the label to its caret, so the label follows the caret when the page scrolls or the text moves. The editor does not need code to position the label.When the label opens,
showCursorLabelpicks its side:CSS uses this side (
data-placement) for the position, for the corner from which the label grows, and for its square corner at the caret. The browser does not flip the label (position-try-fallbacks): it keeps a flipped side after the caret moves away from the edge, and CSS cannot tell which side the browser picked.The closed label is the marker at the top of the caret, as before. It opens and closes with an animation, as before.
Browsers without anchor positioning show the label as before (
@supports). The table and the edges of the screen can still clip it in these browsers.Other changes
showCursorLabels: "always"did not show the labels. Now it shows them.Compared with #3095
#3095 also uses CSS anchor positioning, but it moves the labels into the portal element. This PR keeps each label in its cursor. Thus, it does not need to sync labels with the awareness state, and it does not change the structure of the two cursor plugins. Also, it does not use
@container anchored, which only Chromium supports.Known limitations
showCursorLabels: "always".Tests
cursorLabel.browser.test.ts): a label in a table, at the top and at the right edge of the screen, after the cursor moves away from the right edge, while a collaborator types, and withshowCursorLabels: "always".YCursorPlugin.browser.test.ts): a label after a cursor move, while a collaborator types, withshowCursorLabels: "always", and the removal of the listeners.main.