Skip to content

ConfirmDialog setCloseOnOutsideClick #8126

Open
@sveinnetnordic

Description

@sveinnetnordic

Describe your motivation

Started to replace my old component MyConfirmDialog, which extends Dialog, with the nice ConfirmDialog. Could not find setCloseOnOutsideClick, which I use for Info/Warning.

Describe the solution you'd like

Add

public void setCloseOnOutsideClick(boolean closeOnOutsideClick) {
        getElement().setProperty("noCloseOnOutsideClick", !closeOnOutsideClick);
    }

Describe alternatives you've considered

Currently using this hack:

ConfirmDialog().also {
            it.open()
            it.element.executeJs("overlay.shadowRoot.getElementById('backdrop').onclick = ()=>this.opened=false")
        }

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions