Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Not all CSS properties work in text_extra() #65

Open
1 task done
PhilippSchulz1988 opened this issue Feb 4, 2025 · 0 comments
Open
1 task done

[Bug]: Not all CSS properties work in text_extra() #65

PhilippSchulz1988 opened this issue Feb 4, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@PhilippSchulz1988
Copy link

PhilippSchulz1988 commented Feb 4, 2025

Guidelines

  • I agree to follow this project's Contributing Guidelines.

Project Version

0.2.1

Platform and OS Version

Ubuntu 20.04.1

Existing Issues

No response

What happened?

I have a shiny app with a css style-sheet. Within the shiny app i use reactable and reactable.extras to capture text inputs.


library(shiny)
library(dplyr)
library(reactable)
library(reactable.extras)

df <- tibble(text_col = rep(NA, 5))

tweak_css <- function(file = "style.css") {

  tags$link(rel= "stylesheet",
            type = "text/css",
            href = file) |>
            tags$head()

}


shinyApp(
  ui = fluidPage(
    tweak_css(),
    reactable_extras_dependency(),
    reactableOutput("react"), 
    dataTableOutput("out")
  ),
  server = function(input, output) {
    rv <- reactiveValues(data = df)
    
    
      
    output$react <- renderReactable({
      reactable(
        rv$data,
        
        columns = list(
          
          text_col = colDef(
          cell = text_extra(id = "text", 
                            class = "text-extra"))
        )
        
      )
    })
    
    text_d <- reactive({ input$text}) %>% debounce(3000)    
    
    observeEvent(text_d(), {
      
      rv$data[text_d()$row, text_d()$column] <- text_d()$value
      
    })   
    
    output$out <- renderDataTable({
      rv$data
    })
  }
)

The accompanying style-sheet defines the size of the text input field. I fail to manage preventing text overflow.

.text-extra {
  
  width: 80px;
  height: 80px;
  word-break: break-word;
  
}

I tried several combinations of CSS properties but it does not work to break the line when there is a overflow of text. All other CSS properties work fine.

Steps to reproduce

  1. Generate www folder + copy CSS in file style.css
  2. Adapt path to file in tweak_css()
  3. Run the code for shiny app above.

Expected behavior

If there is text overflow in text_extra() fields there should be a line break.

Attachments

No response

Screenshots or Videos

No response

Additional Information

No response

@PhilippSchulz1988 PhilippSchulz1988 added the bug Something isn't working label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant