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

Modal background effect not disappearing with modal.hide(), Version 0.0.29 #16

Closed
robert-cronin opened this issue Mar 14, 2019 · 2 comments

Comments

@robert-cronin
Copy link
Contributor

I have a modal I initialize and show with the following code in the root of the showcase example:

root = Root("showcase") {
    val modal = Modal("Example Modal", size = ModalSize.LARGE, closeButton = true,
            animation = false, escape = false)
    modal.show()

    tabPanel {
        width = 80.perc
        margin = 20.px
       .....
}

The result looks fine:
Screen Shot 2019-03-14 at 11 44 07 am
until I try to close the modal:
Screen Shot 2019-03-14 at 11 44 17 am
Is there any way to remove the background effect and UI blocking after calling modal.hide() or pressing the closeButton?

@robert-cronin robert-cronin changed the title Modal background effect not disappearing with modal.hide() Modal background effect not disappearing with modal.hide(), Version 0.0.29 Mar 14, 2019
@rjaros
Copy link
Owner

rjaros commented Mar 14, 2019

The problem is you are trying to display the modal window before the root component is initialized and rendered. And the modal is actually showing twice (the background effect is darker than normally). The easiest way to fix this, is to move modal.show() after the Root initializer.

        lateinit var modal: Modal
        root = Root("showcase") {
            modal = Modal("Example Modal", size = ModalSize.LARGE, closeButton = true,
                animation = false, escape = false)
            tabPanel {
                width = 80.perc
                margin = 20.px
                // ...
            }
            // ...
        }
        modal.show()

@robert-cronin
Copy link
Contributor Author

Cheers, closing this issue as solved

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

No branches or pull requests

2 participants