react-component / slider

Compare 79ed454 ... +0 ... d5edcc3

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -70,7 +70,7 @@
Loading
70 70
71 71
    onMouseUpListener: any;
72 72
73 -
    inTrack: boolean;
73 +
    dragTrack: boolean;
74 74
75 75
    startBounds: number[];
76 76
@@ -109,7 +109,7 @@
Loading
109 109
      const value = draggableTrack && this.positionGetValue ? this.positionGetValue(p) || [] : [];
110 110
111 111
      const inPoint = utils.isEventFromHandle(e, this.handlesRefs);
112 -
      this.inTrack =
112 +
      this.dragTrack =
113 113
        draggableTrack &&
114 114
        bounds.length >= 2 &&
115 115
        !inPoint &&
@@ -120,7 +120,7 @@
Loading
120 120
          })
121 121
          .some((c) => !c);
122 122
123 -
      if (this.inTrack) {
123 +
      if (this.dragTrack) {
124 124
        this.dragOffset = p;
125 125
        this.startBounds = [...bounds];
126 126
      } else {
@@ -158,7 +158,7 @@
Loading
158 158
159 159
    onFocus = (e: React.FocusEvent<HTMLDivElement>) => {
160 160
      const { onFocus, vertical } = this.props;
161 -
      if (utils.isEventFromHandle(e, this.handlesRefs) && !this.inTrack) {
161 +
      if (utils.isEventFromHandle(e, this.handlesRefs) && !this.dragTrack) {
162 162
        const handlePosition = utils.getHandleCenterPosition(vertical, e.target);
163 163
        this.dragOffset = 0;
164 164
        this.onStart(handlePosition);
@@ -171,7 +171,7 @@
Loading
171 171
172 172
    onBlur = (e: React.FocusEvent<HTMLDivElement>) => {
173 173
      const { onBlur } = this.props;
174 -
      if (!this.inTrack) {
174 +
      if (!this.dragTrack) {
175 175
        this.onEnd();
176 176
      }
177 177
@@ -192,7 +192,7 @@
Loading
192 192
        return;
193 193
      }
194 194
      const position = utils.getMousePosition(this.props.vertical, e);
195 -
      this.onMove(e, position - this.dragOffset, this.inTrack, this.startBounds);
195 +
      this.onMove(e, position - this.dragOffset, this.dragTrack, this.startBounds);
196 196
    };
197 197
198 198
    onTouchMove = (e: React.TouchEvent<HTMLDivElement>) => {
@@ -202,7 +202,7 @@
Loading
202 202
      }
203 203
204 204
      const position = utils.getTouchPosition(this.props.vertical, e);
205 -
      this.onMove(e, position - this.dragOffset, this.inTrack, this.startBounds);
205 +
      this.onMove(e, position - this.dragOffset, this.dragTrack, this.startBounds);
206 206
    };
207 207
208 208
    onKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {

@@ -113,7 +113,7 @@
Loading
113 113
114 114
  handlesRefs: Record<number, any>;
115 115
116 -
  inTrack: boolean;
116 +
  dragTrack: boolean;
117 117
118 118
  constructor(props: RangeProps) {
119 119
    super(props);
@@ -255,7 +255,7 @@
Loading
255 255
    this.removeDocumentEvents();
256 256
257 257
    if (!handle) {
258 -
      this.inTrack = false;
258 +
      this.dragTrack = false;
259 259
    }
260 260
    if (handle !== null || force) {
261 261
      this.props.onAfterChange(this.getValue());
@@ -266,12 +266,12 @@
Loading
266 266
    });
267 267
  };
268 268
269 -
  onMove(e, position, inTrack, startBounds) {
269 +
  onMove(e, position, dragTrack, startBounds) {
270 270
    utils.pauseEvent(e);
271 271
    const { state, props } = this;
272 272
    const maxValue = props.max || 100;
273 273
    const minValue = props.min || 0;
274 -
    if (inTrack) {
274 +
    if (dragTrack) {
275 275
      const max = maxValue - Math.max(...startBounds);
276 276
      const min = minValue - Math.min(...startBounds);
277 277
      const ratio = Math.min(Math.max(position / (this.getSliderLength() / 100), min), max);

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
src 88.46%
Project Totals (11 files) 88.46%
Loading