Skip to content

Commit

Permalink
Don't get functions from shiny's namespace
Browse files Browse the repository at this point in the history
Fixes #22
  • Loading branch information
gadenbuie committed Jan 28, 2021
1 parent 23f0a2f commit 34131ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Expand Up @@ -27,6 +27,8 @@

* `regexplain_gadget()` now also returns the built regexp directly, enabling
usage like `pattern <- regexplain_gadget()`.

* Fixed an issue with `shiny` version 1.6 (thanks @jthomasmock, #22)

### 0.2.2

Expand Down
7 changes: 2 additions & 5 deletions R/shiny_modified_inputs.R
Expand Up @@ -24,8 +24,6 @@ textAreaInputAlt <- function(
resize = NULL,
is_code = TRUE
) {
`%AND%` <- getFromNamespace("%AND%", "shiny")

value <- shiny::restoreInput(id = inputId, default = value)

if (!is.null(resize)) {
Expand All @@ -50,7 +48,7 @@ textAreaInputAlt <- function(

shiny::div(
class = "form-group shiny-input-container",
label %AND% shiny::tags$label(label, `for` = inputId),
tags$label(label, `for` = inputId),
style = if (!parent_style %in% c(" ", "", " ")) parent_style,
shiny::tags$textarea(
id = inputId,
Expand Down Expand Up @@ -86,13 +84,12 @@ textInputCode <- function(
placeholder = NULL,
...
) {
`%AND%` <- getFromNamespace("%AND%", "shiny")
value <- shiny::restoreInput(id = inputId, default = value)

shiny::div(
class = "input-group shiny-input-container",
style = if (!is.null(width)) paste0("width: ", shiny::validateCssUnit(width), ";"),
label %AND% shiny::tags$label(label, `for` = inputId),
tags$label(label, `for` = inputId),
shiny::tags$input(
id = inputId,
type = "text",
Expand Down

0 comments on commit 34131ab

Please sign in to comment.