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

Waiter doesn't cover all the page #95

Closed
agronomofiorentini opened this issue Jun 9, 2021 · 17 comments
Closed

Waiter doesn't cover all the page #95

agronomofiorentini opened this issue Jun 9, 2021 · 17 comments

Comments

@agronomofiorentini
Copy link

Dear john,
First of all thanks to solve the bs4dash-waiter issue.

I am a strong user of uiOutput and renderUI and therefore my pages with the following of the processing steps become larger and larger.
In fact when I arrived at the second/third step of the processing that performs the shinyapp and I insert inside an observeEvent waiter, it happens that waiter covers only the first portion of the page and not all the rest.

So I wanted to know if there is any tool I can use to enlarge the loading of waiter to the whole page.

Thanks again.

@JohnCoene
Copy link
Owner

Is the loading screen over the uiOutput or over the entire page?

@agronomofiorentini
Copy link
Author

sorry maybe I didn't explain myself well.

Over the entire page.
I mean when I use waiter in a page that is larger than the starting page, waiter does not cover the entire page but only covers the starting portion.

@JohnCoene
Copy link
Owner

OK, can you install the latest dev version, I think this is an issue I already fixed.

remotes::install_github("JohnCoene/waiter")

@agronomofiorentini
Copy link
Author

Of course, and i will let you know as soon as possible.

And for now thanks.

@agronomofiorentini
Copy link
Author

I have downloaded and installed the github version but the issue persist.

I will attach some picture that show my issue, maybe can be more representative.

Screenshot_1
Screenshot_2
Screenshot_3

Thanks a lot john.

JohnCoene added a commit that referenced this issue Jun 10, 2021
@JohnCoene
Copy link
Owner

Ok, apologies.

I just pushed something I think fixes it, could you try to install the Github version again and try?

@agronomofiorentini
Copy link
Author

I have installed again but the issue persist.

sorry for this.

Screenshot_1

@JohnCoene
Copy link
Owner

Don't be sorry, it's not your fault.

After resintalling from Github did you restart the R session to make sure the latest version was loaded?

library(shiny)
library(waiter)

ui <- fluidPage(
  use_waiter(),
	div(
    h1("Content"),
    actionButton("show", "Show"),
    style = "min-height:8000px;"
  )
)

server <- function(input, output, session){
  w <- Waiter$new()

  observeEvent(input$show, {
    w$show()
  })
}

shinyApp(ui, server)

The above works for me

@agronomofiorentini
Copy link
Author

Yes i restart the R session.

I tried your code and worked perfectly, while in my web app the problem persist.

I worked a lot of with golem, and before to load again the app i removed the waiter from the description file and then i re-inserted by using usethis.

Maybe could be something related with bs4dash?

@JohnCoene
Copy link
Owner

There was an issue with the preloader in bs4Dash. David merged my PR fixing this but it's not yet on CRAN. See issue: #93 PR: RinteRface/bs4Dash#213

Though I don't think this can be it. When you restarted the R session did you, after in the browser with the app opened, did you refresh clearing the cache? It could be that it was the old JavaScript was still loaded/cached.

CTRL/CMD + SHIFT + R

@agronomofiorentini
Copy link
Author

There was an issue with the preloader in bs4Dash. David merged my PR fixing this but it's not yet on CRAN. See issue: #93 PR: RinteRface/bs4Dash#213

yes I have known of this change in fact now works perfectly.

Though I don't think this can be it. When you restarted the R session did you, after in the browser with the app opened, did you refresh clearing the cache? It could be that it was the old JavaScript was still loaded/cached.

besides this suggestion I have tried to turn off and on the computer but the problem persists.

@JohnCoene
Copy link
Owner

Oh, sorry it persists. Would you have a small reproducible example for me to debug this?

@agronomofiorentini
Copy link
Author

I will create one and i will provide to you as soon as possible.

For now, again, thanks.

@agronomofiorentini
Copy link
Author

library(shiny)
library(bs4Dash)
library(waiter)
library(DT)
library(palmerpenguins)

ui <- dashboardPage(
  
  title = "Waiter Issue",
  
  fullscreen = TRUE,
  
  preloader = list(html = spin_1(), color = "#333e48"),
  
  header = bs4DashNavbar(title = "Home",
                         compact = TRUE),
  
  sidebar = bs4DashSidebar(collapsed = FALSE,
                           bs4SidebarMenu(bs4SidebarMenuItem(text = "Waiter Issue",
                                                             tabName = "issue", 
                                                             icon = icon("exclamation")))),
  
  controlbar = dashboardControlbar(),
  
  footer = dashboardFooter(left = "Waiter issue",
                           right = "2021"),
  
  body = bs4DashBody(bs4TabItems(bs4TabItem(tabName = "issue",
                                            actionButton("show",
                                                         label = "Waiter Works"),
                                            br(),
                                            dataTableOutput("first_table"),
                                            actionButton("new_issue",
                                                         label = "Waiter cover all the page?"),
                                            uiOutput("first_ui_output"),
                                            br(),
                                            uiOutput("second_ui_output"),
                                            uiOutput("third_ui_output")))))


server <- function(input, output) {
  
  observeEvent(input$show, {
    
    waiter_show(html = spin_fading_circles())
    
    Sys.sleep(3)
    
    waiter_hide()
  })
  
  
  output$first_table<-renderDataTable({
    datatable(penguins)
  })
  
  
  
  
  
  
  observeEvent(input$new_issue, {
    
    waiter_show(html = spin_fading_circles())
    
    Sys.sleep(3)
    
    output$first_ui_output<-renderUI({
      dataTableOutput("second_table")
    })
    
    output$second_table<-renderDataTable({
      datatable(penguins)
    })
    
    output$second_ui_output<-renderUI({
      actionButton("new_issue_1",
                   label = "Let's see again")
    })
    
    waiter_hide()
    
    
    
    observeEvent(input$new_issue_1, {
      
      waiter_show(html = spin_fading_circles())
      
      Sys.sleep(3)
      
      output$second_ui_output<-renderUI({
        dataTableOutput("third_table")
      })
      
      output$third_table<-renderDataTable({
        datatable(penguins)
      })
      
      waiter_hide()
    })
  })
}

shinyApp(ui = ui, server = server)

@aylapear
Copy link

I am having the same problem with the current app I am building where the waiter does not cover the "whole" screen. The code in my app is equivalent to the regex above.

Screen Shot 2021-06-25 at 9 05 57 AM

@JohnCoene
Copy link
Owner

Apologies for this but this time I think I really fixed it.

Could you reinstall the dev version and try again?

remotes::install_github("JohnCoene/waiter")

@agronomofiorentini
Copy link
Author

Dear Jhon,
from my side, it is working perfectly now.

Thanks for the support.

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

3 participants