Shiny selectInput/pickerInput mit langem Namen sollte die Seitenleiste überlaufen
P粉094351878
P粉094351878 2024-02-21 15:22:53
0
1
403

Ich möchte bs4Dash 构建一个闪亮的应用程序。侧边栏包含一个下拉选择菜单,其中包含长名称的项目。打开下拉菜单后,我希望完整的项目名称可见,即溢出仪表板的主体。默认情况下,名称会在侧边栏边框处剪切 (shiny::selectizeInput),或者下拉内容与侧边栏边框右对齐,并且项目名称的开头位于屏幕左侧 (shinyWidgets::pickerInput) in meinem Seitenleistenlayout verwenden. < /p>

So sieht die App aus (aktualisiert am 16. Dezember 2022):

Ich habe versucht, die von flexdashboard beschriebene Lösung anzuwenden Hier, Aber ich bekomme es nicht zum Laufen.

Danke für deine Hilfe!

Hier ist ein reproduzierbares Beispiel meiner Anwendung:

# app.R
library(shiny)
library(bs4Dash)
library(shinyWidgets)

vec_long_items <- sapply(1:10, function(i) {
  paste("START", paste(sample(letters, 100, replace = TRUE), collapse = ""))
})

shinyApp(
  ui = dashboardPage(
    header = bs4DashNavbar(
      title = "Long items to select", disable = TRUE, controlbarIcon = NULL
    ),
    sidebar = bs4DashSidebar(
      skin = "white",
      shinyWidgets::pickerInput(
        inputId = "in1", label = "shinyWidgets::pickerInput", choices = vec_long_items
      ),
      shiny::selectInput(
        inputId = "in2", label = "shiny::selectInput", choices = vec_long_items
      )
    ),
    body = dashboardBody(tableOutput("out_text"))
  ),
  server = function(input, output, session) {
    output$out_text <- renderTable(data.frame(items = vec_long_items))
  },
  options = list(launch.browser = FALSE)
)

Meine Sitzungsinformationen ():

R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)  
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=German_Switzerland.1252  LC_CTYPE=German_Switzerland.1252    LC_MONETARY=German_Switzerland.1252 LC_NUMERIC=C                        LC_TIME=German_Switzerland.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] bs4Dash_2.1.0 shiny_1.7.2

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.7         shinyWidgets_0.7.5 digest_0.6.29      later_1.3.0        mime_0.12          R6_2.5.1           lifecycle_1.0.2    xtable_1.8-4       jsonlite_1.8.0     magrittr_2.0.3
[11] cachem_1.0.6       rlang_1.0.5        cli_3.4.0          fontawesome_0.3.0  promises_1.2.0.1   jquerylib_0.1.4    bslib_0.4.0        ellipsis_0.3.2     tools_4.1.0        httpuv_1.6.5
[21] fastmap_1.1.0      compiler_4.1.0     memoise_2.0.1      htmltools_0.5.2    sass_0.4.2

P粉094351878
P粉094351878

Antworte allen(1)
P粉593536104

试试这个CSS:

css .os-padding {overflow: visible !important;}"

    body = dashboardBody(
      tags$head(
        tags$style(HTML(css))
      ),

      shinyWidgets::pickerInput(
        inputId = "in1", label = "shinyWidgets::pickerInput", choices = vec_long_items, 
        options = pickerOptions(dropdownAlignRight = TRUE)
      ),
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!