Giter Site home page Giter Site logo

Comments (1)

bertuck avatar bertuck commented on June 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.