From 7777d242563cf30f9db35042a445eb6ea7ed39f5 Mon Sep 17 00:00:00 2001 From: Schultheis Date: Tue, 9 Jan 2018 09:26:00 +0100 Subject: [PATCH] columnSelector: don't use deprecated scoped style --- R/columnSelector.R | 6 ++++-- inst/www/styles.css | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/R/columnSelector.R b/R/columnSelector.R index a06320c..159e89a 100644 --- a/R/columnSelector.R +++ b/R/columnSelector.R @@ -13,7 +13,8 @@ columnSelectorUI <- function(id, label = F, title = NULL) { shiny::tagList( shiny::tags$b(title), - shiny::HTML(""), + shinyjs::useShinyjs(), + shiny::singleton(shiny::tags$head(shiny::tags$link(rel = "stylesheet", type = "text/css", href = "wilson_www/styles.css"))), shiny::uiOutput(ns("out")), {if(label) shiny::uiOutput(ns("showLabel"))} ) @@ -78,9 +79,10 @@ columnSelector <- function(input, output, session, type.columns, type = NULL, co if(multiple) { columnSelectLabel = paste0(columnSelectLabel, "(s)") } + shiny::tagList( shiny::selectInput(session$ns("select.type"), label = columnTypeLabel, choices = type.r(), selected = type.r()[1], multiple = FALSE), - shiny::selectizeInput(session$ns("select.column"), label = columnSelectLabel, choices = choices, multiple = multiple) + shiny::div(shiny::selectizeInput(session$ns("select.column"), label = columnSelectLabel, choices = choices, multiple = multiple), class = "empty") # colored background if empty ) }) diff --git a/inst/www/styles.css b/inst/www/styles.css index 0fd7231..aad0d57 100644 --- a/inst/www/styles.css +++ b/inst/www/styles.css @@ -100,3 +100,7 @@ } /* text input */ + +.empty > div .selectize-input:not(.has-items) { + background: #FFFFE1; +}