From c489fef4ff46fc37eb2a7c447a7108afde7ad124 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Fri, 27 Sep 2024 10:09:43 -0400 Subject: [PATCH] fix(input_slider): Make sure last used handle is always above others (#4131) --- NEWS.md | 8 ++++++-- inst/www/shared/ionrangeslider/css/ion.rangeSlider.css | 4 ++++ inst/www/shared/ionrangeslider/scss/shiny.scss | 5 +++++ .../0001-Add-skin-customized-for-Shiny.patch | 7 ++++++- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index ff1a3900c1..30dd6c1742 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,14 +4,18 @@ * Small improvements to the default pulse busy indicator to better blend with any background. It's also now slightly smaller by default. (#4122) +## Bug fixes + +* Fixed a bug in `conditionalPanel()` that would cause the panel to repeatedly show/hide itself when the provided condition was not boolean. (@kamilzyla, #4127) + +* Fixed a bug with `input_slider()` when used as a range slider that made it impossible to change the slider value when both handles were at the maximum value. (#4131) + # shiny 1.9.1 ## Bug fixes * Fixed a bug introduced in v1.9.0 where the boundaries of hover/click/brush regions on plots were being incorrectly scaled when browser zoom was used. (#4111) -* Fixed a bug in `conditionalPanel()` that would cause the panel to repeatedly show/hide itself when the provided condition was not boolean. (@kamilzyla, #4127) - # shiny 1.9.0 ## New busy indication feature diff --git a/inst/www/shared/ionrangeslider/css/ion.rangeSlider.css b/inst/www/shared/ionrangeslider/css/ion.rangeSlider.css index 5b1a8f4b4a..a95e944a18 100644 --- a/inst/www/shared/ionrangeslider/css/ion.rangeSlider.css +++ b/inst/www/shared/ionrangeslider/css/ion.rangeSlider.css @@ -235,6 +235,10 @@ z-index: 2; } +.irs--shiny .irs-handle.type_last { + z-index: 3; +} + .irs--shiny .irs-handle.state_hover, .irs--shiny .irs-handle:hover { background: #fff; } diff --git a/inst/www/shared/ionrangeslider/scss/shiny.scss b/inst/www/shared/ionrangeslider/scss/shiny.scss index 72203cc230..c882844622 100644 --- a/inst/www/shared/ionrangeslider/scss/shiny.scss +++ b/inst/www/shared/ionrangeslider/scss/shiny.scss @@ -143,6 +143,11 @@ $font-family: $font-family-base !default; border-radius: $handle_width; z-index: 2; + &.type_last { + // Ensure last-used handle is on top if it overlaps with another handle + z-index: 3; + } + &.state_hover, &:hover { background: $handle_color_hover; diff --git a/tools/ion.rangeSlider-patches/0001-Add-skin-customized-for-Shiny.patch b/tools/ion.rangeSlider-patches/0001-Add-skin-customized-for-Shiny.patch index 185f3a56bc..d9bb9f5aec 100644 --- a/tools/ion.rangeSlider-patches/0001-Add-skin-customized-for-Shiny.patch +++ b/tools/ion.rangeSlider-patches/0001-Add-skin-customized-for-Shiny.patch @@ -3,7 +3,7 @@ new file mode 100644 index 00000000..ba052f8b --- /dev/null +++ b/inst/www/shared/ionrangeslider/scss/shiny.scss -@@ -0,0 +1,201 @@ +@@ -0,0 +1,206 @@ +/* 'shiny' skin for Ion.RangeSlider, largely based on the 'big' skin, but with smaller dimensions, grayscale grid text, and without gradients +© Posit, PBC, 2023 +© RStudio, Inc, 2014 @@ -149,6 +149,11 @@ index 00000000..ba052f8b + border-radius: $handle_width; + z-index: 2; + ++ &.type_last { ++ // Ensure last-used handle is on top if it overlaps with another handle ++ z-index: 3; ++ } ++ + &.state_hover, + &:hover { + background: $handle_color_hover;