Skip to content
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

Dialog no longer resizes automatically after dragging. #436

Closed
Frettman opened this issue Jan 18, 2021 · 5 comments · Fixed by #7970
Closed

Dialog no longer resizes automatically after dragging. #436

Frettman opened this issue Jan 18, 2021 · 5 comments · Fixed by #7970

Comments

@Frettman
Copy link

First of all, I'm using the Java API in case that makes a difference.

I have a dialog with a details area that I can show and hide (using setVisible of Component/Element). Usually the dialog resizes (and recenters) accordingly on its own. But after dragging the dialog the size seems to be fixed and a scrollbar appears instead of increasing the dialog's size.

@vaadin-bot vaadin-bot transferred this issue from vaadin/vaadin-dialog May 19, 2021
@vaadin-bot vaadin-bot added needs research More information needed to estimate vaadin-dialog labels May 19, 2021
@web-padawan
Copy link
Member

web-padawan commented Jul 13, 2022

The issue appears to be caused by setting width and height on the overlay part when dragging starts:

if (this.$.overlay.$.overlay.style.position !== 'absolute') {
this.$.overlay.setBounds(this._originalBounds);
}

Note: the same logic is also executed when resizing starts:

if (this.$.overlay.$.overlay.style.position !== 'absolute') {
this.$.overlay.setBounds(this._originalBounds);
}

@web-padawan
Copy link
Member

As a workaround, it's possible to use this to ensure the above code never runs:

dialog.$.overlay.$.overlay.style.position = 'absolute';

However, if header or footer is provided, dragging either of them will also resize dialog in this case 🙈

@web-padawan web-padawan removed the needs research More information needed to estimate label Jul 13, 2022
@sissbruecker
Copy link
Contributor

Not locking in the width when starting dragging can have some interesting side effects if the dialog has a max width:

Bildschirmaufnahme.2022-10-14.um.18.55.53.mp4

That seems to be because the max-width is applied on the parent element of the element that is actually being dragged, which also adds a margin that the dragged element tries to respect.

@jouni
Copy link
Member

jouni commented Oct 14, 2022

Would it be possible to fix the size only for the duration of the drag?

@yuriy-fix
Copy link
Contributor

For extra details please check vaadin/flow-components#4083 as well

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

Successfully merging a pull request may close this issue.

6 participants