Skip to content

Build your personal knowledge base with Trilium Notes

client/image viewer: fix viewport size for the full view of attachments

Adorian Doranecb6a3002d73
diff --git a/apps/client/src/widgets/type_widgets/Attachment.css b/apps/client/src/widgets/type_widgets/Attachment.css
index bccf523d84..9ff1173962 100644
--- a/apps/client/src/widgets/type_widgets/Attachment.css
+++ b/apps/client/src/widgets/type_widgets/Attachment.css
@@ -115,9 +115,13 @@
object-fit: unset;
}
-/* Anchor the sibling-navigation overlay to the viewer. */
+/* Anchor the sibling-navigation overlay to the viewer, and constrain the viewer to its flex slot so
+ a tall image fits the viewport instead of growing the layout. overflow:hidden also zeroes the flex
+ auto min-height (otherwise the item won't shrink below the image's intrinsic height), matching the
+ note-image wrapper. */
.attachment-content-wrapper.attachment-image-viewer {
position: relative;
+ overflow: hidden;
}
.attachment-detail-wrapper.scheduled-for-deletion .attachment-content-wrapper img {
@@ -145,6 +149,9 @@
.attachment-detail .attachment-wrapper {
flex-grow: 1;
+ /* Let this flex item shrink to its slot; without it the default min-height:auto lets tall content
+ (e.g. the full-view image) grow past the viewport, and .note-detail then clips the overflow. */
+ min-height: 0;
}
/* #endregion */