Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@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
commit: |
| withinPortal={false} | ||
| opened={opened} | ||
| position={position} | ||
| zIndex={10000} |
There was a problem hiding this comment.
I prefer more reasonable values for z-index, but I've not seen what this is compared to
There was a problem hiding this comment.
Each of the UI elements is a multiple of 1000 (1000 for side menu, 3000 for formatting toolbar, etc), so this is continuing that pattern.
| <MantinePopover withinPortal={false} opened={opened} position={position}> | ||
| <MantinePopover | ||
| middlewares={{ size: { padding: 20 } }} | ||
| withinPortal={false} |
There was a problem hiding this comment.
@matthewlipski only seeing this now, but can't we use withinPortal instead of using our own createPortal?
There was a problem hiding this comment.
Technically yes, functionally it is the same. However, since we only use a portal for the emoji picker, and neither Ariakit nor ShadCN have popover options to render in a portal, I decided to go with this approach as it's less code and easier to maintain.
Summary
This PR makes a few changes to the emoji picker, mostly related to overflow handling. A few minor styling changes have also been made for the comments & thread examples.
Closes #2053
Rationale
To deal with longer threads, consumers may set a may height on them and make them scrollable. In this case, the emoji picker gets cut off, leading to bad UX.
Changes
The Mantine popover component now gets auto-sized based on the available space. Most UI elements that use this component are small and don't really need it, but it's useful for the emoji picker which can overflow more often (especially on the small website example boxes).
The popover for the emoji picker now also gets rendered in a portal which attaches it to the editor element (
.bn-container). To ensure it remains on top, the z-index of popover components has been increased. This shouldn't have much of an effect outside the emoji picker. The emoji picker in the threads sidebar also still works as expected with these changes.Finally, the logic for keeping the action toolbar open while picking emojis has been updated to work with the portal.
Impact
Z-index of popovers has been increased, but this shouldn't have a noticable impact on other elements that use popovers like the create link button of replace file button.
Testing
N/A
Screenshots/Video
Checklist
Additional Notes