JohnCoene / waiter

🕰️ Loading screens for Shiny
https://waiter.john-coene.com/
Other
495 stars 25 forks source link

Using Waiter on Tabpanel #147

Closed AnuradhaSurendra closed 5 months ago

AnuradhaSurendra commented 6 months ago

Hi, I am new to using Waiter and I am wonder how to use it to block all elements on a tabpanel. I have tried the following:

    waiter_show( id="tabA"
      html = spin_fading_circles() # use a spinner
    )

But that does not work.

JohnCoene commented 6 months ago

We can't do that because tab ids are dynamically generated but we can wrap the tab in a div, assign it an id and use that instead.

navbarPage(
  "page",
  tabPanel(
    "first",
    div(
      id = "first", 
      ...,
      style = "min-height:100vh" # optional but may make it look nicer
    )
  )
)

Then use

waiter_show( 
  id="first"
)
AnuradhaSurendra commented 5 months ago

John, thank you. This worked perfectly!

JohnCoene commented 5 months ago

Good to hear!