Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(file-viewer): prevent scroll bleed and zoom button micro-pans
  • Loading branch information
waleedlatif1 committed Mar 29, 2026
commit 5e7e9797a2c4e8072a780ccc256aa170437434db
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,8 @@ const ImagePreview = memo(function ImagePreview({ file }: { file: WorkspaceFileR
const el = containerRef.current
if (!el) return
const onWheel = (e: WheelEvent) => {
e.preventDefault()
if (e.ctrlKey || e.metaKey) {
e.preventDefault()
setZoom((z) => clampZoom(z * (1 - e.deltaY * ZOOM_WHEEL_SENSITIVITY)))
Comment thread
waleedlatif1 marked this conversation as resolved.
Outdated
} else {
setOffset((o) => ({ x: o.x - e.deltaX, y: o.y - e.deltaY }))
Expand Down Expand Up @@ -521,7 +521,10 @@ const ImagePreview = memo(function ImagePreview({ file }: { file: WorkspaceFileR
loading='eager'
/>
</div>
<div className='absolute right-4 bottom-4 flex items-center gap-1 rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-2 py-1 shadow-sm'>
<div
className='absolute right-4 bottom-4 flex items-center gap-1 rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-2 py-1 shadow-sm'
onMouseDown={(e) => e.stopPropagation()}
>
<button
type='button'
onClick={zoomOut}
Expand Down
Loading