我们显示要用selectInput()
选择的长字符串(路径)。我们的问题是路径太长而无法完整显示(请参见屏幕截图)。
虽然我们可以使用以下代码在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
中),但是这样做很重要。如何实现?