aria-valuemax with stepsArray has array length instead of value

Open
#403 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
angular, typescript

Research direction

Start with the official homepage custom-ticks example and inspect how stepsArray produces the rendered aria-valuemin and aria-valuemax attributes. Confirm the current output shown in the issue, then make the completed behavior report the first and last step values—1 and 9—instead of the array bounds.

Written by the indexing model from the issue text.

Description

bug

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

Dominant language
TypeScript
Stars
412
Forks
177
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from angular-slider/ngx-slider

All issues in angular-slider/ngx-slider

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.