Skip to content

Comments

refactor: make keepInViewport respect --vaadin-overlay-viewport-inset#11193

Open
sissbruecker wants to merge 1 commit intomainfrom
refactor/keep-in-viewport-respect-dialog-inset
Open

refactor: make keepInViewport respect --vaadin-overlay-viewport-inset#11193
sissbruecker wants to merge 1 commit intomainfrom
refactor/keep-in-viewport-respect-dialog-inset

Conversation

@sissbruecker
Copy link
Contributor

Description

Dialogs with centered positioning use max-width: 100%, which refers to the overlay host element. That element uses --vaadin-overlay-viewport-inset to offset itself from the viewport. Thus center positioned dialogs by default keep an offset from the viewport's edges. However, when dragging with keepInViewport enabled 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

  • Refactor

@sonarqubecloud
Copy link

Copy link
Contributor

@DiegoCardoso DiegoCardoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants