slider icon indicating copy to clipboard operation
slider copied to clipboard

Fix keyboard control for null step with marks

Open weijiangan opened this issue 4 years ago • 2 comments

Currently, util.calculateNextValue() incorrectly returns mark object instead of value when steps are disabled (by passing null to step prop) and marks are used

The consequence of this is keyboard navigation will crash the slider due to unhandled errors that stem from unexpected value type.

Steps to reproduce

  1. Pass a marks object as prop to slider component
  2. Pass step = {null} as prop to slider component
  3. Manipulate slider position using arrow keys

weijiangan avatar Dec 10 '19 18:12 weijiangan

Codecov Report

Merging #607 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #607   +/-   ##
======================================
  Coverage    95.4%   95.4%           
======================================
  Files           2       2           
  Lines          87      87           
  Branches       29      29           
======================================
  Hits           83      83           
  Misses          4       4
Impacted Files Coverage Δ
src/utils.js 95% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 34fca54...4665779. Read the comment docs.

codecov[bot] avatar Dec 10 '19 18:12 codecov[bot]

Rebase please.

yoyo837 avatar Apr 15 '23 15:04 yoyo837