Skip to content

[Bug]: Placeholder doesn't follow the tag it covers #32

@jakubsob

Description

@jakubsob

Guidelines

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

Project Version

0.0.0.9002

Platform and OS Version

Windows

Existing Issues

No response

What happened?

Placeholder doesn't follow the component it's supposed to cover when programatically changing it's location.

Steps to reproduce

  1. Click Toggle panel button

Expected behavior

When #container1 is hidden #container2 slides into its place with a placeholder instead of sliding from underneath the placeholder.

Attachments

library(shiny)
library(shiny.emptystate)
library(bslib)

ui <- page(
  theme = bs_theme(version = 5),
  use_empty_state(),
  tags$button(
    "Toggle panel",
    class = "btn btn-primary",
    onClick = "$('#container1').toggle(anim = 'slide');"
  ),
  div(
    style = "width: 300px",
    class = "d-flex flex-column gap-5",
    div(
      id = "container1",
      div(
        h1("Card 1"),
        "Card content"
      )
    ),
    div(
      id = "container2",
      div(
        h1("Card 2"),
        "Card content"
      )
    )
  )
)

server <- function(input, output, session) {
  empty_state_content <- div(
    "This is example empty state content"
  )
  empty_state_manager <- EmptyStateManager$new(
    id = "container2",
    html_content = empty_state_content
  )
  empty_state_manager$show()
}

shinyApp(ui, server)

Screenshots or Videos

Screenshare.-.2023-07-11.12_56_21.PM.mp4

Additional Information

No response

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