feat(range): add ticks attribute (#17718)

closes #17717
This commit is contained in:
Seth Lilly
2019-03-26 14:33:16 -04:00
committed by Brandy Carney
parent 583c43127b
commit 016fa16d44
11 changed files with 105 additions and 55 deletions

View File

@ -105,6 +105,12 @@ export class Range implements ComponentInterface {
*/
@Prop() step = 1;
/**
* If `true`, tick marks are displayed based on the step value.
* Only applies when `snaps` is `true`.
*/
@Prop() ticks = true;
/**
* If `true`, the user cannot interact with the range.
*/
@ -393,7 +399,7 @@ export class Range implements ComponentInterface {
const end = isRTL ? 'left' : 'right';
const ticks = [];
if (this.snaps) {
if (this.snaps && this.ticks) {
for (let value = min; value <= max; value += step) {
const ratio = valueToRatio(value, min, max);