Skip to content

Spinner does not appear in Shiny application #48

@edwardlavender

Description

@edwardlavender

I have wrapped the example for ?addSpinner into an R Shiny application., but the spinner does not appear.

Here is a reproducible example based on the example given for ?addSpinner. I expected a spinner to appear during the 'sleep' phase, but no spinner appears.

library(shiny)
library(leaflet)
library(leaflet.extras2)
library(magrittr)

ui <- fluidPage(
  leafletOutput("leaf")
)

sleep <- function(map){
  Sys.sleep(5)
  map
}

server <- function(input, output){
  output$leaf <- 
    renderLeaflet({
      leaflet(data = quakes) %>%
        addTiles()  %>%
        addSpinner() %>%
        startSpinner(options = list("lines" = 7, "length" = 20)) %>%
        sleep() %>%
        addMarkers(~long, ~lat, popup = ~as.character(mag), label = ~as.character(mag)) %>%
        stopSpinner()
    })
}

shinyApp(ui, server)

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstreamBug in upstream repo

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions