Skip to content

[Bug]: Empty state content overlays modal dialog #52

Open
@calderonsamuel

Description

@calderonsamuel

Guidelines

  • I agree to follow this project's Contributing Guidelines.

Project Version

1.0

Platform and OS Version

Tested in Windows and Google Chrome

Existing Issues

No response

What happened?

I wanted to use a modal when the empty state content is shown

Steps to reproduce

  1. Run the following app. Try showing the modal with and without the empty state shown.
library(shiny)
library(shiny.emptystate)

ui <- fluidPage(
  use_empty_state(),
  actionButton("show", "Show empty state!"),
  actionButton("hide", "Hide empty state!"),
  actionButton("modal", "Show modal"),
  tableOutput("my_table")
)

server <- function(input, output, session) {
  empty_state_content <- div(
    "This is  example empty state content"
  )
  
  empty_state_manager <- EmptyStateManager$new(
    id = "my_table",
    html_content = empty_state_content
  )
  
  observeEvent(input$show, empty_state_manager$show())
  
  observeEvent(input$hide, empty_state_manager$hide())
  
  observeEvent(input$modal, {
    showModal(modalDialog(title = "Hello from modal"))
  })
  
  output$my_table <- renderTable(mtcars)
}

shinyApp(ui, server)

Expected behavior

The modal shoul be over the empty state content

Attachments

No response

Screenshots or Videos

No response

Additional Information

It seems to be that the problem is here:

.empty-state-container {
z-index: 9999;
}

But I don't know what would be the best solution for it 🤔

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions