Opening Dialog scrolls layout back to the top

I guess I’ll just inherit from Dialog and overwrite the modal behavior, and just create a fullscreen background div that captures all clicks

https://github.com/vaadin/flow-components/blob/2479ab03c7703bf725b55a09844cb68ef6e42cf2/vaadin-dialog-flow-parent/vaadin-dialog-flow/src/main/java/com/vaadin/flow/component/dialog/Dialog.java#L447 doesn’t say anything about modal as requirement… so I would call it a bug if it doesn’t work with non modal

Maybe, but this has never worked for non-modal dialogs afaik

Technically, overwriting setModal should be enough. Just remove the second line

https://github.com/vaadin/flow-components/blob/2479ab03c7703bf725b55a09844cb68ef6e42cf2/vaadin-dialog-flow-parent/vaadin-dialog-flow/src/main/java/com/vaadin/flow/component/dialog/Dialog.java#L486

Damn… okay not so easy… the second line is also called indirectly in open/setOpen :nerd_face:

But it sounds “easily” possible to create a client side modal dialog with a server side non modal dialog

I’ll try overwriting isModal as well and see if it works

yea, that works

You have to make sure that setChildComponentModal is gone everywhere or reset, Like done when the dialog is closed

    @Override
    public void setModal(boolean modal) {
        getElement().setProperty("modeless", !modal);
    }

    @Override
    public boolean isModal() {
        return false;
    }

Oh that would also work :joy: other methods just use isModal :+1:

Kinda breaks the isModal API, but I don’t use that anywhere

works for me :slightly_smiling_face: Thank you very much for the help