-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
textAreaInput()
doesn't work as expected for relative width
#2049
Conversation
Being bite again... Isn't it a bug? |
Am I correct that, if |
Merge remote-tracking branch 'origin/master' into textarea-style # Conflicts: # R/input-textarea.R
@wch Thanks for pointing out this. Now it should have worked expectedly. Example codelibrary(shiny)
charornull <- function(x) {
if (nzchar(x)) x else NULL
}
ui <- fluidPage(
inputPanel(
textInput('area_width', 'area-width', '50%'),
textInput('area_height', 'area-height', ''),
textInput('area_rows', 'area-rows', ''),
textInput('area_cols', 'area-cols', '')
),
uiOutput('ui_text_area')
)
server <- function(input, output) {
output$ui_text_area <- renderUI({
textAreaInput("text_area", label = NULL,
width = charornull(input$area_width),
height = charornull(input$area_height),
rows = charornull(input$area_rows),
cols = charornull(input$area_cols))
})
}
shiny::shinyApp(ui, server) Output |
@wch Not to push... but this has been opened for two and half years already... Is there any potential drawbacks of this fix so it's hanged for so long ? I'm asking this is because I use a lot of this function and being unable to set the pct of the width forces me to define a seperate function every time, which is ugly and inconvinient... Would be highly appreciated if this issue can be fixed soon... |
Squashed commit of the following: commit a823dd5d7da6fafba69f783e112d71d9dcd09c5f Author: Winston Chang <winston@stdout.org> Date: Mon Oct 12 12:59:41 2020 -0500 Remove trailing whitespace commit ae55b519fb0f7d97f559e2f487063366926aa41d Author: Winston Chang <winston@stdout.org> Date: Mon Oct 12 12:52:04 2020 -0500 Move NEWS item to correct location commit aa89abc247be1bf5cdf093ff7fe7c51711821438 Merge: ee98773 a1ff765 Author: Winston Chang <winston@stdout.org> Date: Mon Oct 12 12:47:21 2020 -0500 Merge branch 'master' into shrektan-textarea-style commit ee98773 Author: shrektan <shrektan@126.com> Date: Sat Aug 24 10:35:23 2019 +0800 correct the NEWS entry commit b468d8f Author: shrektan <shrektan@126.com> Date: Sat Aug 24 10:32:52 2019 +0800 the width of textarea should be specified in the parent div. commit 5abdcf9 Merge: 03079f0 b07e553 Author: shrektan <shrektan@126.com> Date: Sat Aug 24 09:54:27 2019 +0800 resolve conflicts Merge remote-tracking branch 'origin/master' into textarea-style # Conflicts: # R/input-textarea.R commit 03079f0 Author: shrektan <shrektan@126.com> Date: Mon May 7 16:08:05 2018 +0800 Fixed a bug that `textAreaInput()` doesn't work as expected for relative `width`.
Sorry for the delay. I fixed the news locally and squash-merged it in c498b02. |
Example Code
Before this PR
After this PR