Текст для функции 'label_on' (woolWidgets> prettyToggle) слишком длинный и выходит за рамки поля. Как мне обернуть текст и остаться внутри поля?
Я обнаружил подобную проблему здесь, но для pickerInput ( Как отформатировать варианты переноса из pickerInput, если длина вариантов длинна, выбор частов конечном итоге за пределами экрана ).
Я также добавил (теги $ style (HTML ('. Pretty .state label {white-space: normal; word-break: keep-all;})')) но значок отключен.
library(shiny); library(shinydashboard); library(shinyWidgets)
ui <- dashboardPage(
dashboardHeader(title = "THE RAFT"),
dashboardSidebar(sidebarMenu(menuItem("Introduction", tabName = "intro", icon = icon("dashboard")))),
dashboardBody(
# run this command line to wrap text but as a result icon is off set
# tags$style(HTML('.pretty .state label { white-space: normal; word-break: keep-all; }')),
tabItems(tabItem(tabName = "intro", box(title = "Box 1",
prettyToggle(inputId = "inp001", icon_on = icon("thumbs-up"), icon_off = icon("thumbs-down"),
outline = TRUE, plain = TRUE, animation = "rotate",
label_off = "Here's some text that takes more than one line on the screen. I want it to wrap, but it just keeps going to the right out of view in its container.",
label_on = "Short"
))))))
server <- function(input, output) { }
shinyApp(ui, server)