src/common/createSlider.tsx
changed.
src/Slider.tsx
changed.
106 | 106 | const { draggableTrack, vertical: isVertical } = this.props; |
|
107 | 107 | const { bounds } = this.state; |
|
108 | 108 | ||
109 | - | const value = this.positionGetValue(p) || []; |
|
109 | + | const value = draggableTrack && this.positionGetValue ? this.positionGetValue(p) || [] : []; |
|
110 | 110 | ||
111 | 111 | const inPoint = utils.isEventFromHandle(e, this.handlesRefs); |
|
112 | 112 | this.inTrack = |
119 | 119 | }) |
|
120 | 120 | .some((c) => !c); |
|
121 | 121 | ||
122 | - | const handlePosition = utils.getHandleCenterPosition(isVertical, e.target); |
|
123 | - | ||
124 | 122 | if (this.inTrack) { |
|
125 | 123 | this.dragOffset = p; |
|
126 | 124 | this.startBounds = [...bounds]; |
128 | 126 | if (!inPoint) { |
|
129 | 127 | this.dragOffset = 0; |
|
130 | 128 | } else { |
|
129 | + | const handlePosition = utils.getHandleCenterPosition(isVertical, e.target); |
|
131 | 130 | this.dragOffset = p - handlePosition; |
|
132 | 131 | p = handlePosition; |
|
133 | 132 | } |
62 | 62 | return 0; |
|
63 | 63 | } |
|
64 | 64 | ||
65 | + | positionGetValue = (position): number[] => { |
|
66 | + | return []; |
|
67 | + | }; |
|
68 | + | ||
65 | 69 | calcOffset(value: number) { |
|
66 | 70 | return 0; |
|
67 | 71 | } |
246 | 250 | ariaLabelledBy: ariaLabelledByForHandle, |
|
247 | 251 | ariaValueTextFormatter: ariaValueTextFormatterForHandle, |
|
248 | 252 | style: handleStyle[0] || handleStyle, |
|
249 | - | ref: h => this.saveHandle(0, h), |
|
253 | + | ref: (h) => this.saveHandle(0, h), |
|
250 | 254 | }); |
|
251 | 255 | ||
252 | 256 | const trackOffset = startPoint !== undefined ? this.calcOffset(startPoint) : 0; |
Files | Coverage |
---|---|
src | 85.13% |
Project Totals (11 files) | 85.13% |