-
-
Notifications
You must be signed in to change notification settings - Fork 538
feat: File previewWidth
prop defaults to undefined
#1664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the width is undefined like this. What is the behaviour for very large, and very small images?
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-docx-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
commit: |
Very large images are max. the width of the editor, set in CSS. Very small images will just be very small resizing and stuff should still work, though we have a min-width when resizing of 64px, otherwise the resize handles don't have enough space. If an image is less than 64px wide, it will get resized to 64px immediately when dragging the resize handles. I think it's a pretty minor edge case that someone uploads an image or video <64px wide, as even things like icons are not usually smaller than that, so imo no need to add extra logic for this. |
This PR makes it so file blocks with a
previewWidth
prop have it default toundefined
. This makes it so that when an image is inserted into the document, it retains its original resolution, or spans the editor width, whichever is lower.Closes #1600