R Shiny 的 PrettyRadioButtons 答案选项不会根据屏幕尺寸换行
为什么这个 prettyRadioButtons
问题的长答案选项不会根据屏幕尺寸自动换行?下面是模拟不同设备的 Chrome 浏览器 Inspect 模式的两张屏幕截图。
即使手动将宽度设置为“300px”也不会包装答案选项。
library(shiny)
library(bslib)
library(shinyWidgets)
ui <- bootstrapPage(
theme = bs_theme(version = 5, "font-scale" = 1.0),
div(class = "container-fluid",
div(class = "row",
div(class="col-12",
prettyRadioButtons(
inputId = "a",
label = "Group A",
selected = NULL,
status = "primary",
shape = c("round"),
width = NULL,
choiceNames = c("Lorem Ipsum is simply dummy text of the ",
"printing and typesetting industry.Lorem Ipsum has",
"been the industry's standard dummy text ever since the 1500s, when an unknown printer"),
choiceValues = c("opt1", "opt2", "opt3")
)
)
)
)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
Why do the long answer options of this prettyRadioButtons
question not automatically wrap based on the screen size? Below are two screenshots of the Chrome browser's Inspect mode simulating different devices.
Even manually setting the width to "300px" doesn't wrap the answer options.
library(shiny)
library(bslib)
library(shinyWidgets)
ui <- bootstrapPage(
theme = bs_theme(version = 5, "font-scale" = 1.0),
div(class = "container-fluid",
div(class = "row",
div(class="col-12",
prettyRadioButtons(
inputId = "a",
label = "Group A",
selected = NULL,
status = "primary",
shape = c("round"),
width = NULL,
choiceNames = c("Lorem Ipsum is simply dummy text of the ",
"printing and typesetting industry.Lorem Ipsum has",
"been the industry's standard dummy text ever since the 1500s, when an unknown printer"),
choiceValues = c("opt1", "opt2", "opt3")
)
)
)
)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能是 Chrome 的问题。如果 Inspect 打开时将
Dimensions:
设置为Responsive
,然后我切换到 iPhone SE,它就可以工作。如果 Inspect 打开时将
Dimensions:
设置为iPhone SE
,则答案选项将始终被截断。This may be an issue with Chrome. If Inspect opens with
Dimensions:
set toResponsive
and then I switch to iPhone SE it works.If Inspect opens with
Dimensions:
set toiPhone SE
the answer options will always be cutoff.