Comments (1)
Patch to apply via patch-package to resolve issue : (waiting for PR to be merged #182)
react-range+1.8.14.patch
diff --git a/node_modules/react-range/lib/Range.js b/node_modules/react-range/lib/Range.js
index 2403f9d..f276ec3 100644
--- a/node_modules/react-range/lib/Range.js
+++ b/node_modules/react-range/lib/Range.js
@@ -68,6 +68,10 @@ var Range = /** @class */ (function (_super) {
_this.getOffsets = function () {
var _a = _this.props, direction = _a.direction, values = _a.values, min = _a.min, max = _a.max;
var trackElement = _this.trackRef.current;
+ if (!trackElement) {
+ console.warn('No track element found.');
+ return [];
+ }
var trackRect = trackElement.getBoundingClientRect();
var trackPadding = (0, utils_1.getPaddingAndBorder)(trackElement);
return _this.getThumbs().map(function (thumb, index) {
@@ -523,7 +527,9 @@ var Range = /** @class */ (function (_super) {
document.removeEventListener('touchstart', this.onMouseOrTouchStart);
document.removeEventListener('mouseup', this.schdOnEnd);
document.removeEventListener('touchend', this.schdOnEnd);
- this.resizeObserver.unobserve(this.trackRef.current);
+ if (this.trackRef && this.trackRef.current) {
+ this.resizeObserver.unobserve(this.trackRef.current);
+ }
};
Range.prototype.render = function () {
var _this = this;
from react-range.
Related Issues (20)
- Old React syntax HOT 1
- How to disable specific thumb in multi-range slider? HOT 1
- Crashes when max size is set to over 10million and step size is 1. HOT 1
- 'Range' cannot be used as a JSX component. Its instance type 'Range' is not a valid JSX element. HOT 6
- Focus ring around the thumb is visible on mouse drag HOT 3
- Issue when the state values is updated with more number of values.
- Uncaught TypeError: Property 'handleEvent' is not callable. Range.js HOT 1
- Passing disabled props into renderThumb
- ChainAlert: npm package release (1.8.13) has no matching tag in this repo
- Slider jumps back to the start position in iOS Safari HOT 1
- React complaining on missing unike key in array of element HOT 1
- Marks do not correctly re-render on state change HOT 2
- Incorrect draggedTrackPos X coordinate value during DnD Track
- onChange can't prevent event bubbling
- Throwing errors vs console.warn
- A props object containing a "key" prop is being spread into JSX: HOT 3
- node 18 support
- First onChange in a slider greater than the viewport not registering correctly HOT 1
- Query: No overlap but allow neighbouring handles to be pushed around
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-range.