refactor: make keepInViewport respect --vaadin-overlay-viewport-inset#11193
Open
sissbruecker wants to merge 1 commit intomainfrom
Open
refactor: make keepInViewport respect --vaadin-overlay-viewport-inset#11193sissbruecker wants to merge 1 commit intomainfrom
sissbruecker wants to merge 1 commit intomainfrom
Conversation
|
DiegoCardoso
approved these changes
Feb 24, 2026
Contributor
DiegoCardoso
left a comment
There was a problem hiding this comment.
The changes look good to me.
I noticed some behavior that is unrelated to these changes, but to the keepInViewport feature:
- Drag the dialog to an edge (keep the mouse down)
- Keep moving the cursor towards the edge
- While keeping the mouse down, move back in the opposite direction
- The dialog won't move until the pointer passes the original position related to the dialog when the mouse was first pressed
dialog-sticky.mp4
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.



Description
Dialogs with centered positioning use
max-width: 100%, which refers to the overlay host element. That element uses--vaadin-overlay-viewport-insetto offset itself from the viewport. Thus center positioned dialogs by default keep an offset from the viewport's edges. However, when dragging withkeepInViewportenabled it currently does not respect this offset and instead allows dragging to the very edge of the viewport.IMO it would be more consistent if this feature respects the inset as well. This would also make it easier to implement some follow up features like making the dialog adapt when the viewport size changes in a consistent manner.
Part of vaadin/flow-components#8600
Type of change