Fix org chart canvas height to fit viewport without scrolling
The height calc subtracted only 4rem but the actual overhead is ~6rem (3rem breadcrumb bar + 3rem main padding). Also use dvh for better mobile support. Co-Authored-By: Paperclip <noreply@paperclip.ing> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -269,7 +269,7 @@ export function OrgChart() {
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
ref={containerRef}
|
ref={containerRef}
|
||||||
className="w-full h-[calc(100vh-4rem)] overflow-hidden relative bg-muted/20 border border-border rounded-lg"
|
className="w-full h-[calc(100dvh-6rem)] overflow-hidden relative bg-muted/20 border border-border rounded-lg"
|
||||||
style={{ cursor: dragging ? "grabbing" : "grab" }}
|
style={{ cursor: dragging ? "grabbing" : "grab" }}
|
||||||
onMouseDown={handleMouseDown}
|
onMouseDown={handleMouseDown}
|
||||||
onMouseMove={handleMouseMove}
|
onMouseMove={handleMouseMove}
|
||||||
|
|||||||
Reference in New Issue
Block a user