fix(canvas): prevent unnecessary page scrolling - #461
Open
mohamad-fallah wants to merge 1 commit into
Open
mohamad-fallah wants to merge 1 commit into
mohamad-fallah wants to merge 1 commit into
Conversation
The canvas always reserved two extra grid rows, which caused vertical scrolling even when every widget fit inside the viewport. Only reserve the extra rows while the canvas is in edit mode. Normal mode now follows the actual widget height while preserving scroll for overflowing layouts.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The widget canvas remained vertically scrollable even when all widgets fit inside the viewport.
Root cause
The canvas always reserved two extra grid rows:
const totalGridRows = Math.max(6, maxWidgetRow + 2)These empty rows increased the canvas height during normal use and created unnecessary vertical scrolling.
Changes
The canvas height now follows the last occupied widget row in normal mode.
Two extra rows are reserved only in edit mode so users can still move widgets into empty space.
Layouts containing widgets below the viewport continue to scroll normally.
Left out
No widget positions, collision behavior, responsive layout rules, or visual styles were changed.
Testing
npm run compilepassednpm run buildpassednpm testcould not start becausebunis unavailable on PATHVisual checklist