feat(labelary-preview): inset background and overflow scrolling for o…#9
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the LabelPreviewModal by refining border styles and introducing a scrollable container for label previews to improve visibility. A review comment suggests adding 'max-w-none' and 'max-h-none' to the preview image to ensure it renders at its natural size and correctly triggers the new scrollable behavior.
| <img | ||
| src={previewUrl} | ||
| alt="Label preview" | ||
| className="block shrink-0" | ||
| /> |
There was a problem hiding this comment.
To allow oversized labels to actually overflow and trigger the scrollbars as intended, you should add max-w-none and max-h-none to the img tag. By default, Tailwind's preflight (and most CSS resets) applies max-width: 100% and height: auto to images, which will scale the label down to fit the modal width even if the container is scrollable. Adding these classes ensures the image renders at its natural size from the Labelary API.
{!loading && !error && previewUrl && (
<img
src={previewUrl}
alt="Label preview"
className="block shrink-0 max-w-none max-h-none"
/>
)}
…versized labels