ng2-nouislider icon indicating copy to clipboard operation
ng2-nouislider copied to clipboard

vertical support?

Open ronlawrence3 opened this issue 8 years ago • 5 comments

I've been trying to create a nouislider with a vertical orientation, but the handles seem to be stuck at 0. My config looks like:

someRange=[5,95];
sideSlideConfig = {
    connect: true,
    start: [5,95],
    range: {
      min: 0,
      max: 100
    },
    pips: {
      mode: 'steps',
      stepped: true,
      density: 2,
      values: 100
    },
    orientation: 'vertical'
  };
<nouislider [config]="sideSlideConfig" [(ngModel)]="someRange"></nouislider>

ronlawrence3 avatar Feb 22 '17 04:02 ronlawrence3

Set dimensions..Vertical sliders don't assume a default height, so you'll need to set one. You can use any unit you want, including % or px.

Sariq avatar Jul 05 '17 10:07 Sariq

To help other lost souls, specifically I had to set the height css attribute for class "noUi-vertical" to get this to work. Notably, setting the height css rule on the nouislider element itself didn't work, feels like there should be some way in angular for that to work as such.

vicatcu avatar Aug 14 '17 19:08 vicatcu

@vicatcu thank you! I had to set the .noUi-vertical height value in the top level global styles.css for this to work.

mtclark0518 avatar Apr 08 '18 19:04 mtclark0518

@vicatcu thank you! I had to set the .noUi-vertical height value in the top level global styles.css for this to work.

would you mind posting the css here? cheers!

artaniszeratul avatar Mar 28 '19 11:03 artaniszeratul

@artaniszeratul

In your global stylesheet (styles.[s]css)

    .noUi-vertical {
        height: 400px;
    }

You could also use ng-deep, but it will go away and browser-support is declining at this point, so I would advice against it in the general case.

In your components [s]css

::ng-deep {
    .noUi-vertical {
        height: 400px;
    }
}

riscie avatar Apr 16 '19 12:04 riscie