leongersen / noUiSlider

noUiSlider is a lightweight, ARIA-accessible JavaScript range slider with multi-touch and keyboard support. It is fully GPU animated: no reflows, so it is fast; even on older devices. It also fits wonderfully in responsive designs and has no dependencies.
https://refreshless.com/nouislider/
MIT License
5.69k stars 657 forks source link

Upgraded 13.1.0 -> 14.6.2 handles disappeared #1104

Closed jukkahuuskonen closed 3 years ago

jukkahuuskonen commented 4 years ago

Hi,

I upgraded noUiSilder from v.13.1.0 -> 14.6.2 and now my handles disappeared. I have a 3rd party modified css-file, css was actually from v.11.1.0, according t the file, but it worked fine. Is there any documentation on changes that could cause this or do I need to learn all the nouislider css to recreate sliders the same way? I couldn't find any info on changelog. My css-file is in the end.

-Jukka

/*! nouislider - 11.1.0 - 2018-04-02 11:18:13 */
/* Functional styling;
* These styles are required for noUiSlider to function.
* You don't need to change these rules to apply your design.
*/
/*
This file was modified by Creative-Tim
*/

.noUi-target,
.noUi-target * {
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-user-select: none;
  -ms-touch-action: none;
  touch-action: none;
  -ms-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

.noUi-target {
  top: 5;
  position: relative;
  direction: ltr;
}

.noUi-base,
.noUi-connects {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

/* Wrapper for all connect elements.
*/
.noUi-connects {
  overflow: hidden;
  z-index: 0;
}

.noUi-connect,
.noUi-origin {
  will-change: transform;
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  -ms-transform-origin: 0 0;
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
}

/* Offset direction
*/
html:not([dir="rtl"]) .noUi-horizontal .noUi-origin {
  left: auto;
  right: 0;
}

/* Give origins 0 height/width so they don't interfere with clicking the
* connect elements.
*/
.noUi-vertical .noUi-origin {
  width: 0;
}

.noUi-horizontal .noUi-origin {
  height: 0;
}

.noUi-handle {
  position: absolute;
}

.noUi-state-tap .noUi-connect,
.noUi-state-tap .noUi-origin {
  -webkit-transition: transform 0.3s;
  transition: transform 0.3s;
}

.noUi-state-drag * {
  cursor: inherit !important;
}

/* Slider size and handle placement;
*/
.noUi-horizontal {
  height: 4px;
}

.noUi-horizontal .noUi-handle {
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  left: -10px;
  top: -13px;
  cursor: pointer;
  border-radius: 100%;
  transition: all 0.2s ease-out;
  border: 1px solid $brand-primary;
  background: rgba(0, 0, 0, 0.2);
  // background: transparent;
  // background: $white-color;

  @include shadow-2dp();
}

.noUi-vertical {
  width: 2px;
  margin: 0 15px;
  height: 100%;
}

.noUi-vertical .noUi-handle {
  box-sizing: border-box;
  width: 14px;
  height: 14px;
  left: -6px;
  top: -10px;
  cursor: pointer;
  border-radius: 100%;
  transition: all 0.2s ease-out;
  border: 1px solid $brand-primary;
  background: $white-color;

  @include shadow-2dp();
}

html:not([dir="rtl"]) .noUi-horizontal .noUi-handle {
  right: -15px;
  left: auto;
}

/* Styling;
* Giving the connect element a border radius causes issues with using transform: scale
*/
.noUi-target {
  background-color: #c8c8c8;
  border-radius: 3px;
}

.noUi-connects {
  border-radius: 3px;
}

.noUi-connect {
  background: #888;
  border-radius: 3px;
  -webkit-transition: background 450ms;
  transition: background 450ms;
}

/* Handles and cursors;
*/
.noUi-draggable {
  cursor: ew-resize;
}

.noUi-vertical .noUi-draggable {
  cursor: ns-resize;
}

.noUi-handle {
  border-radius: 3px;
  background: #FFF;
  cursor: default;
  box-shadow: inset 0 0 1px #FFF, inset 0 1px 7px #EBEBEB, 0 3px 6px -3px #BBB;
  -webkit-transition: 300ms ease 0s;
  -moz-transition: 300ms ease 0s;
  -ms-transition: 300ms ease 0s;
  -o-transform: 300ms ease 0s;
  transition: 300ms ease 0s;

  &:focus {
    outline: none;
  }
}

.noUi-active {
  box-shadow: inset 0 0 1px #FFF, inset 0 1px 7px #DDD, 0 3px 6px -3px #BBB;
}

/* Disabled state;
*/
[disabled] .noUi-connect {
  background: #B8B8B8;
}

[disabled].noUi-target,
[disabled].noUi-handle,
[disabled] .noUi-handle {
  cursor: not-allowed;
}

/* Base;
*
*/
.noUi-pips,
.noUi-pips * {
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

.noUi-pips {
  position: absolute;
  color: #999;
}

/* Values;
*
*/
.noUi-value {
  position: absolute;
  white-space: nowrap;
  text-align: center;
}

.noUi-value-sub {
  color: grey;
  font-size: 10px;
}

.noUi-value-large {
  color: black;
}

/* Markings;
*
*/
.noUi-marker {
  position: absolute;
  background: #CCC;
}

.noUi-marker-sub {
  background: #AAA;
}

.noUi-marker-large {
  background: #AAA;
}

/* Horizontal layout;
*
*/
.noUi-pips-horizontal {
  padding: 10px 0;
  height: 0px;
  top: -14px;
  left: 0;
  width: 100%;
}

.noUi-value-horizontal {
  -webkit-transform: translate(-50%, 50%);
  transform: translate(-50%, 50%);
}

.noUi-rtl .noUi-value-horizontal {
  -webkit-transform: translate(50%, 50%);
  transform: translate(50%, 50%);
}

.noUi-marker-horizontal.noUi-marker {
  margin-left: -1px;
  width: 2px;
  height: 12px;
}

.noUi-marker-horizontal.noUi-marker-sub {
  height: 10px;
  top: 6px;
}

.noUi-marker-horizontal.noUi-marker-large {
  height: 15px;
  top: 3px;
}

/* Vertical layout;
*
*/
.noUi-pips-vertical {
  padding: 0 10px;
  height: 100%;
  top: 0;
  left: 100%;
}

.noUi-value-vertical {
  -webkit-transform: translate(0, -50%);
  transform: translate(0, -50%, 0);
  padding-left: 25px;
}

.noUi-rtl .noUi-value-vertical {
  -webkit-transform: translate(0, 50%);
  transform: translate(0, 50%);
}

.noUi-marker-vertical.noUi-marker {
  width: 5px;
  height: 2px;
  margin-top: -1px;
}

.noUi-marker-vertical.noUi-marker-sub {
  width: 10px;
}

.noUi-marker-vertical.noUi-marker-large {
  width: 15px;
}

.noUi-tooltip {
  display: none;
  position: absolute;
  border: 1px solid #D9D9D9;
  border-radius: 3px;
  background: #fff;
  color: #000;
  padding: 2px;
  text-align: center;
  white-space: nowrap;
}

.tooltip-show {
  display: block;
}

.noUi-active .noUi-tooltip {
  display: block;
}

.noUi-horizontal .noUi-tooltip {
  -webkit-transform: translate(-50%, 0);
  transform: translate(-50%, 0);
  left: 50%;
  bottom: 120%;
}

.noUi-vertical .noUi-tooltip {
  -webkit-transform: translate(0, -50%);
  transform: translate(0, -50%);
  top: 50%;
  right: 120%;
}

.c-transparent {
  background: transparent;
}

.c-red {
  background: #d01c8b;
}

.c-green {
  background: #4dac26;
}

.noUi-target {

  & .noUi-handle {
    border: 3px solid #333;
  }

  &.scheduleSlider {

    // & .noUi-connect,
    // &.noUi-connect {
    //  background-color: $brand-primary;
    // }

    & .noUi-handle {
      border-color: green;
    }
  }

  &.slider-primary {

    & .noUi-connect,
    &.noUi-connect {
      background-color: $brand-primary;
    }

    & .noUi-handle {
      border-color: $brand-primary;
    }
  }

  &.slider-info {

    & .noUi-connect,
    &.noUi-connect {
      background-color: $brand-info;
    }

    & .noUi-handle {
      border-color: $brand-info;
    }
  }

  &.slider-success {

    & .noUi-connect,
    &.noUi-connect {
      background-color: $brand-success;
    }

    & .noUi-handle {
      border-color: $brand-success;
    }
  }

  &.slider-warning {

    & .noUi-connect,
    &.noUi-connect {
      background-color: $brand-warning;
    }

    & .noUi-handle {
      border-color: $brand-warning;
    }
  }

  &.slider-danger {

    & .noUi-connect,
    &.noUi-connect {
      background-color: $brand-danger;
    }

    & .noUi-handle {
      border-color: $brand-danger;
    }
  }

  &.slider-rose {

    & .noUi-connect,
    &.noUi-connect {
      background-color: $brand-rose;
    }

    & .noUi-handle {
      border-color: $brand-rose;
    }
  }

}
leongersen commented 4 years ago

You'll need to incorporate these styling changes.

jukkahuuskonen commented 4 years ago

Thanks, Really fast support. I'll have to try this next week, if I have time. -Jukka

tosegard commented 3 years ago

@leongersen I had this same issue and your suggested changes fixed it for me. Thanks!

leongersen commented 3 years ago

That's great, happy to help!

github-actions[bot] commented 2 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.