-
-
Notifications
You must be signed in to change notification settings - Fork 602
Zoom-on-Scroll Support in Image Preiew #530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rahulharpal1603
merged 19 commits into
AOSSIE-Org:main
from
DecodeX15:feat/Zoom-on-Scroll_support
Oct 23, 2025
Merged
Changes from 6 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
4e03380
new feature of scrolling in image preview
DecodeX15 08f56f6
fixing linting error
DecodeX15 e9c757a
removing console
DecodeX15 8f18d7d
update branch
DecodeX15 1142f6b
finally fixed the zooming logic after
DecodeX15 f7ea813
liting error
DecodeX15 630bf6b
remove space
DecodeX15 39cdc52
update
DecodeX15 21a52e2
done
DecodeX15 a8041eb
add
DecodeX15 f49e63e
update branch
DecodeX15 e0f78b0
update branch
DecodeX15 057561b
logic fixed using library
DecodeX15 140a580
lint fix
DecodeX15 bd473e2
final commit
DecodeX15 24f30c9
lint
DecodeX15 5c53ba9
fix
DecodeX15 9e60af3
Refactor ImageViewer to remove drag-related props
rahulharpal1603 bf3cc48
Remove mouse event handlers from MediaView
rahulharpal1603 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move
onWheelto the parent div for consistent cursor position handling.The
onWheelhandler is attached to theimgelement (line 52), while all other interaction handlers (onClick,onMouseDown,onMouseMove,onMouseUp,onMouseLeave) are attached to the parentdiv(lines 37-41). This inconsistency creates coordination problems because cursor position calculations will be relative to different elements. For zoom-to-cursor functionality to work correctly, the wheel event must capture the cursor position relative to the same element as the other handlers.Apply this diff to move
onWheelto the parent div:<div id="zoomable-image" className="relative" onClick={onClick} onMouseDown={onMouseDown} onMouseMove={onMouseMove} onMouseUp={onMouseUp} onMouseLeave={onMouseLeave} + onWheel={onWheel} > <img src={convertFileSrc(imagePath) || '/placeholder.svg'} alt={alt} draggable={false} onError={(e) => { const img = e.target as HTMLImageElement; img.onerror = null; img.src = '/placeholder.svg'; }} - onWheel={onWheel} style={{📝 Committable suggestion
🤖 Prompt for AI Agents