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

dateInput()'s popup is incorrectly positioned when using bootstrap 5 top margin on parent container #4088

Open
kennedymwavu opened this issue Jun 6, 2024 · 2 comments

Comments

@kennedymwavu
Copy link

Without any top margin on parent div, the calendar popup displays well:

library(shiny)

ui <- bslib::page(
  theme = bslib::bs_theme(version = 5, preset = "bootstrap"),
  tags$div(
    dateInput(inputId = "mydate", label = "My date")
  )
)

server <- \(input, output, session) {}

shinyApp(ui, server)

image

But when you add a top margin to the parent div, the popup displays over the input:

library(shiny)

ui <- bslib::page(
  theme = bslib::bs_theme(version = 5, preset = "bootstrap"),
  tags$div(
    class = "mt-5", # add top margin
    dateInput(inputId = "mydate", label = "My date")
  )
)

server <- \(input, output, session) {}

shinyApp(ui, server)

image

@cpsievert
Copy link
Collaborator

Interesting, thanks! FWIW, I think this achieves what you're looking for?

bslib::page(
    theme = bslib::bs_theme(version = 5, preset = "bootstrap"),
    tags$div(class = "pt-5"),
    dateInput(inputId = "mydate", label = "My date")
)

@kennedymwavu
Copy link
Author

Yes, using padding works well.

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

2 participants