使用shinydashboard的框功能时扩展符号被截断

问题描述

我有一个仪表板,里面有一个可折叠的盒子,效果很好,但出于某种原因,当盒子折叠时,+ 符号被切断(见下文)。有谁知道如何解决这个问题?

enter image description here

enter image description here

## app.R ##
library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(),dashboardSidebar(),dashboardBody(
    Box(id = "tableBox",collapsible = TRUE,collapsed = F,width = "100%",height = "100%","Taco Bell is an American-based chain of fast food restaurants originating in Irvine,California in 1962,by founder Glen Bell. Taco Bell is a 
        subsidiary of Yum! Brands,Inc. The restaurants serve a variety of Mexican-inspired foods,that include: tacos,burritos,quesadillas,nachos,novelty and specialty items,along with a variety of value menu items. As of 2018,Taco Bell serves over two billion customers each year,at 
        7,072 restaurants,more than 93 percent of which are owned and operated by independent franchisees and licensees.")
  )
)

server <- function(input,output) { }

shinyApp(ui,server)

解决方法

一个可能的解决方法是更改​​ box() 生成的 html 代码,搜索

## app.R ##
library(shiny)
library(shinydashboard)

box_html <- 
'<div class="col-sm-100%">
  <div class="box" style="height: 100%">
    <div class="box-header" style="height: 40px; width: 50; pxtext-align: right;border: 0;"> 
      <div class="box-tools pull-right">
        <button class="btn btn-box-tool" data-widget="collapse">
          <i class="fa fa-minus" role="presentation" aria-label="minus icon" style="size:10px"></i>
        </button>
      </div>
    </div>
    <div class="box-body" id="tableBox">Taco Bell is an American-based chain of fast food restaurants originating in Irvine,California in 1962,by founder Glen Bell. Taco Bell is a 
        subsidiary of Yum! Brands,Inc. The restaurants serve a variety of Mexican-inspired foods,that include: tacos,burritos,quesadillas,nachos,novelty and specialty items,along with a variety of value menu items. As of 2018,Taco Bell serves over two billion customers each year,at 
        7,072 restaurants,more than 93 percent of which are owned and operated by independent franchisees and licensees.</div>
  </div>
</div>'

ui <- dashboardPage(
    dashboardHeader(),dashboardSidebar(),dashboardBody(
        uiOutput('box')))

server <- function(input,output) { 
    
    output$box <- renderUI({
        tagList(
            HTML(box_html)
        )
        
    })
}

shinyApp(ui,server)