Skip to content

Commit 6be6dfb

Browse files
gadenbuiecpsievertjcheng5
authored
Finer-grained control over shiny-provided input bindings (#3861)
Co-authored-by: Carson Sievert <[email protected]> Co-authored-by: Joe Cheng <[email protected]> Co-authored-by: gadenbuie <[email protected]>
1 parent 6fc0628 commit 6be6dfb

28 files changed

+37
-23
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: shiny
22
Type: Package
33
Title: Web Application Framework for R
4-
Version: 1.7.4.9002
4+
Version: 1.7.4.9003
55
Authors@R: c(
66
person("Winston", "Chang", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0002-1576-2126")),
77
person("Joe", "Cheng", role = "aut", email = "[email protected]"),

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
* Allow for `shiny:::toJSON()` to respect if `digits=` has class `"AsIs"` which represents if `use_signif=` is `TRUE` or `FALSE`. This is useful for testing to keep the digits smaller. For example, setting `options(shiny.json.digits = 4)` will save 4 digits after the decimal, rather than the default of `I(16)` which will save 16 significant digits. (#3819)
1616

17+
* Closed #2956: Component authors can now prevent Shiny from creating an input binding on specific elements by adding the `data-shiny-no-bind-input` attribute to the element. The attribute may have any or no value; its presence will prevent binding. This feature is primarily useful for input component authors who want to use standard HTML input elements without causing Shiny to create an input binding for them. Additionally, Shiny now adds custom classes to its inputs. For example, `checkboxInput()` now has a `shiny-input-checkbox` class. These custom classes may be utilized in future updates to Shiny's input binding logic. (#3861)
18+
1719
### Bug fixes
1820

1921
* Fixed #3771: Sometimes the error `ion.rangeSlider.min.js: i.stopPropagation is not a function` would appear in the JavaScript console. (#3772)

R/input-checkbox.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ checkboxInput <- function(inputId, label, value = FALSE, width = NULL) {
3131

3232
value <- restoreInput(id = inputId, default = value)
3333

34-
inputTag <- tags$input(id = inputId, type="checkbox")
34+
inputTag <- tags$input(id = inputId, type="checkbox", class = "shiny-input-checkbox")
3535
if (!is.null(value) && value)
3636
inputTag$attribs$checked <- "checked"
3737

R/input-file.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ fileInput <- function(inputId, label, multiple = FALSE, accept = NULL,
101101

102102
inputTag <- tags$input(
103103
id = inputId,
104+
class = "shiny-input-file",
104105
name = inputId,
105106
type = "file",
106107
# Don't use "display: none;" style, which causes keyboard accessibility issue; instead use the following workaround: https://css-tricks.com/places-its-tempting-to-use-display-none-but-dont/

R/input-numeric.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ numericInput <- function(inputId, label, value, min = NA, max = NA, step = NA,
3535
value <- restoreInput(id = inputId, default = value)
3636

3737
# build input tag
38-
inputTag <- tags$input(id = inputId, type = "number", class="form-control",
38+
inputTag <- tags$input(id = inputId, type = "number", class="shiny-input-number form-control",
3939
value = formatNoSci(value))
4040
if (!is.na(min))
4141
inputTag$attribs$min = min

R/input-password.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ passwordInput <- function(inputId, label, value = "", width = NULL,
3535
div(class = "form-group shiny-input-container",
3636
style = css(width = validateCssUnit(width)),
3737
shinyInputLabel(inputId, label),
38-
tags$input(id = inputId, type="password", class="form-control", value=value,
38+
tags$input(id = inputId, type="password", class="shiny-input-password form-control", value=value,
3939
placeholder = placeholder)
4040
)
4141
}

R/input-select.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ selectInput <- function(inputId, label, choices, selected = NULL,
106106
# create select tag and add options
107107
selectTag <- tags$select(
108108
id = inputId,
109+
class = "shiny-input-select",
109110
class = if (!selectize) "form-control",
110111
size = size,
111112
selectOptions(choices, selected, inputId, selectize)

R/input-text.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ textInput <- function(inputId, label, value = "", width = NULL,
4242
div(class = "form-group shiny-input-container",
4343
style = css(width = validateCssUnit(width)),
4444
shinyInputLabel(inputId, label),
45-
tags$input(id = inputId, type="text", class="form-control", value=value,
45+
tags$input(id = inputId, type="text", class="shiny-input-text form-control", value=value,
4646
placeholder = placeholder)
4747
)
4848
}

R/input-textarea.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ textAreaInput <- function(inputId, label, value = "", width = NULL, height = NUL
6262
style = if (!is.null(width)) paste0("width: ", validateCssUnit(width), ";"),
6363
tags$textarea(
6464
id = inputId,
65-
class = "form-control",
65+
class = "shiny-input-textarea form-control",
6666
placeholder = placeholder,
6767
style = style,
6868
rows = rows,

inst/www/shared/shiny-autoreload.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)