react-component / slider
Showing 1 of 3 files from the diff.
Other files ignored by Codecov

@@ -182,8 +182,8 @@
Loading
182 182
      return;
183 183
    }
184 184
    const currentValue = value || prevState.bounds;
185 -
    if (currentValue.some((v) => utils.isValueOutOfRange(v, this.props))) {
186 -
      const newValues = currentValue.map((v) => utils.ensureValueInRange(v, this.props));
185 +
    if (currentValue.some(v => utils.isValueOutOfRange(v, this.props))) {
186 +
      const newValues = currentValue.map(v => utils.ensureValueInRange(v, this.props));
187 187
      onChange(newValues);
188 188
    }
189 189
  }
@@ -196,7 +196,7 @@
Loading
196 196
    } else {
197 197
      const controlledState = {};
198 198
199 -
      ['handle', 'recent'].forEach((item) => {
199 +
      ['handle', 'recent'].forEach(item => {
200 200
        if (state[item] !== undefined) {
201 201
          controlledState[item] = state[item];
202 202
        }
@@ -272,13 +272,15 @@
Loading
272 272
    const maxValue = props.max || 100;
273 273
    const minValue = props.min || 0;
274 274
    if (dragTrack) {
275 +
      let pos = props.vertical ? -position : position;
276 +
      pos = props.reverse ? -pos : pos;
275 277
      const max = maxValue - Math.max(...startBounds);
276 278
      const min = minValue - Math.min(...startBounds);
277 -
      const ratio = Math.min(Math.max(position / (this.getSliderLength() / 100), min), max);
278 -
      const nextBounds = startBounds.map((v) =>
279 +
      const ratio = Math.min(Math.max(pos / (this.getSliderLength() / 100), min), max);
280 +
      const nextBounds = startBounds.map(v =>
279 281
        Math.floor(Math.max(Math.min(v + ratio, maxValue), minValue)),
280 282
      );
281 -
      if (state.bounds.map((c, i) => c === nextBounds[i]).some((c) => !c)) {
283 +
      if (state.bounds.map((c, i) => c === nextBounds[i]).some(c => !c)) {
282 284
        this.onChange({
283 285
          bounds: nextBounds,
284 286
        });
@@ -502,7 +504,7 @@
Loading
502 504
      ariaValueTextFormatterGroupForHandles,
503 505
    } = this.props;
504 506
505 -
    const offsets = bounds.map((v) => this.calcOffset(v));
507 +
    const offsets = bounds.map(v => this.calcOffset(v));
506 508
507 509
    const handleClassName = `${prefixCls}-handle`;
508 510
    const handles = bounds.map((v, i) => {
@@ -529,7 +531,7 @@
Loading
529 531
        reverse,
530 532
        disabled,
531 533
        style: handleStyle[i],
532 -
        ref: (h) => this.saveHandle(i, h),
534 +
        ref: h => this.saveHandle(i, h),
533 535
        ariaLabel: ariaLabelGroupForHandles[i],
534 536
        ariaLabelledBy: ariaLabelledByGroupForHandles[i],
535 537
        ariaValueTextFormatter: ariaValueTextFormatterGroupForHandles[i],
Files Coverage
src 88.49%
Project Totals (11 files) 88.49%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading