mcollovati / vaadin-spinkit

SpinKit component for Vaadin
Apache License 2.0
2 stars 0 forks source link

Spinner is not shown if added to a dialog #3

Closed Dudeplayz closed 3 years ago

Dudeplayz commented 3 years ago

I tried to create a modal dialog and add the Spinner to show some loading screen. But the spinner isn't visible. In a normal view it works fine.

class LoadingIndicator : Dialog() {
    init {
        val spinner = Spinner(SpinnerType.CIRCLE_FADE).centered().large()
        add(spinner)
        isCloseOnEsc = false
        isCloseOnOutsideClick = false
        isModal = true
    }
}
mcollovati commented 3 years ago

As a workaround you can add a CSS rule to spinkit element

spinkit {
    display: inline-block;
}

or define a class and apply it to the Spinner element

mcollovati commented 3 years ago

Added css class .sk-display-block and helper methods (set|with)DisplayBlock on Spinner class