-
Notifications
You must be signed in to change notification settings - Fork 153
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
pickerInput choices alignment #112
Comments
Here is a code clarify the issue (devel versions of both shinyWidgets and bs4Dash) :
Maybe it's related to bs4Dash ? |
Hi, library(shiny)
library(bs4Dash)
library(shinyWidgets)
my_choices <- c(
"Choice 1 is small","Choice 2 is average sized",
"But choice 3 is very big and sometimes when the length of the qption is long it leaves the screen, so I need a UI fix to wrap the question to fit the width of the pickerInput. I want pickerInput because it has select all/deselect all button."
)
my_choices2 <- stringr::str_wrap(my_choices, width = 30)
my_choices2 <- stringr::str_replace_all(my_choices2, "\\n", "<br>")
shinyApp(
ui = bs4DashPage(
navbar = bs4DashNavbar(),
sidebar = bs4DashSidebar(
bs4SidebarMenuItem(
tags$div(
style = "overflow: visible;",
shinyWidgets::pickerInput(
inputId = "filtre",
label = "Filter",
multiple = TRUE,
width = "100%",
choices = my_choices,
options = list(`dropdown-align-right` = TRUE),
choicesOpt = list(
content = my_choices2
)
)
)
)
),
body = bs4DashBody()
),
server = function(input, output) {}
) See this SO post for more : https://stackoverflow.com/questions/51355878/how-to-text-wrap-choices-from-a-pickerinput-if-the-length-of-the-choices-are-lo/51406191#51406191 Victor |
Thank you Victor, I am going to use break lines |
Hi, I test
pickerInput
with bothshinydashboard
andbs4Dash
(which was recently supported Thanks!).I use
pickerInput
with long text choices, so the frame width is extended to have full text visible.My issue is that with
shinydashboard
, the choices text are left aligned, and withbs4Dash
right aligned.I guess it has to do with bootstrap 3 vs bootstrap 4.
I tried without success to use options
dropdownAlignRight
anddata-dropdown-align-right
withTRUE
andFALSE
(snapappointments/bootstrap-select#1127 (comment))Would you have another solution to set alignment text ?
The text was updated successfully, but these errors were encountered: