强制selectInput换行

时间:2020-11-09 14:35:38

标签: r shinyapps

我们显示要用selectInput()选择的长字符串(路径)。我们的问题是路径太长而无法完整显示(请参见屏幕截图)。

enter image description here

虽然我们可以使用以下代码在selectize-dropdown元素中进行自动换行:

tagList(
          selectInput(inputId = "relativepath",
                      label = "resource relativepath:",
                      choices = res$relativepath,
                      multiple = resourcemultiple),
          actionButton("load", "load selected data resource", icon("upload")),
          tags$style(    type = 'text/css',
                         ".selectize-input { word-wrap : break-word;}
                         .selectize-dropdown {word-wrap : break-word;} "
          )
        )

,基于以下堆栈溢出问题的解决方案:Prevent selectInput from wrapping text

word-wrap : break-words css声明不适用于已经选择的字符串/路径(在selectize-input中),但是这样做很重要。如何实现?

0 个答案:

没有答案