Skip to content

aria-valuemax with stepsArray has array length instead of value #403

@s-kirchner

Description

@s-kirchner

When a stepsArray is used, the aria-valuemin and aria-valuemax values are showing array sizes, and not the corresponding values. Taking the example from the official homepage:

import { Component } from '@angular/core';
import { Options } from '@angular-slider/ngx-slider';

@Component({
    selector: 'app-custom-ticks-legend-slider',
    templateUrl: './custom-ticks-legend-slider.component.html',
    standalone: false
})
export class CustomTicksLegendSliderComponent {
  value: number = 5;
  options: Options = {
    showTicksValues: true,
    stepsArray: [
      {value: 1, legend: 'Very poor'},
      {value: 2},
      {value: 3, legend: 'Fair'},
      {value: 4},
      {value: 5, legend: 'Average'},
      {value: 6},
      {value: 7, legend: 'Good'},
      {value: 8},
      {value: 9, legend: 'Excellent'}
    ]
  };
}

This renders the following HTML code:

<span _ngcontent-ng-c4030736784="" ngxsliderhandle="" class="ngx-slider-span ngx-slider-pointer ngx-slider-pointer-min" style="opacity: 1; visibility: visible; left: 615px; transform: rotate(0deg);" role="slider" tabindex="0" aria-orientation="horizontal" aria-label="ngx-slider" aria-labelledby="" aria-valuenow="5" aria-valuetext="5" aria-valuemin="0" aria-valuemax="8"></span>

aria-valuemin=0 and aria-valuemax=8 but they should be 1 and 9 respectively

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions