I'm trying to add multiple aligned inputs in a dashboard and it works fine with textInput()
but I dont understand why it gets all crazy when I change for a pickerInput()
?
library(shiny)
library(shinyBS)
library(dplyr)
library(htmltools)
ui = fluidPage(
sidebarPanel(
# textInput
splitLayout(
div(style = "display: flex; justify-content: space-between; gap: 1rem;",
textInput("datset_location", "textInput1", value = "", width = "100%", placeholder = NULL),
tags$span(
popify(bsButton("pointlessButton1", "Button", style = "primary", size = "Large") %>%
tagAppendAttributes(style = "margin-top: 2.5rem;"),
"Select data",
"Type the location of the data"),
))),
# textInput2
splitLayout(
div(style = "display: flex; justify-content: space-between; gap: 1rem;",
textInput("datset_location", "textInput2", value = "", width = "100%", placeholder = NULL),
tags$span(
popify(bsButton("pointlessButton1", "Button", style = "primary", size = "Large") %>%
tagAppendAttributes(style = "margin-top: 2.5rem;"),
"Select data",
"Type the location of the data"),
))),
# pickerInput
splitLayout(
div(style = "display: flex; justify-content: space-between; gap: 1rem;",
pickerInput("datset_location", "Data location", choices = c("A", "B", "C"), width = "auto"),
tags$span(
popify(bsButton("pointlessButton2", "Button", style = "primary", size = "Large") %>%
tagAppendAttributes(style = "margin-top: 2.5rem;"),
"Select data",
"Type the location of the data"),
)))
)
)
server = function(input, output, seassion){
}
shinyApp(ui = ui, server = server)
Update: Here is an update after clarification: (revmoved first answer) Use fluidRow and column: