docs(markdown-editor): trim the height comment to the two load-bearing gotchas

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Sergey Kozyrenko
2026-07-08 13:22:06 +07:00
co-authored by Claude Opus 4.8
parent d378b9f582
commit fdc533aba4
@@ -80,12 +80,9 @@ export function MarkdownEditorField({
[mode, onChange, disabled],
);
// The field owns its height so no consumer repeats it: it fills its flex parent on desktop (the split-view
// panes) and takes a FIXED near-viewport height on mobile/tablet (the stacked forms). Fixed, not `min-h`, so a
// long doc scrolls inside the editor instead of stretching the page to its full content height — the mobile
// stack has no flex parent to cap it. Keyed off the SAME breakpoint hook the surrounding layouts switch on so
// the two never disagree; a plain CSS media-query variant would drift from that JS breakpoint. `className` is
// last, so a consumer can still override the height.
// `h-`, not `min-h`: the mobile/tablet stack has no flex parent to cap the box, so `min-h` would let a long
// doc stretch the editor (and the page) to full content height instead of scrolling inside it. Height tracks
// useBreakpoint, not a CSS variant, because the layouts split at 1200px — which is no Tailwind breakpoint.
const { isDesktop } = useBreakpoint();
const boxClassName = cn(isDesktop ? 'min-h-0 flex-1' : 'h-[calc(100dvh-5rem)]', className);