Skip to content

Commit ad1bb9d

Browse files
monicaogkatsev
authored andcommitted
fix(seek-bar): ensure aria-valuenow attribute in seek-bar is not NaN (#5164)
Updated the getPercent function to return 0 instead of NaN. This is in accordance with the return value in the function's jsdocs. Fixes #4960.
1 parent d446828 commit ad1bb9d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/js/control-bar/progress-control/seek-bar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class SeekBar extends Slider {
171171
getPercent() {
172172
const percent = this.getCurrentTime_() / this.player_.duration();
173173

174-
return percent >= 1 ? 1 : percent;
174+
return percent >= 1 ? 1 : (percent || 0);
175175
}
176176

177177
/**

0 commit comments

Comments
 (0)