Open amaau opened 7 years ago
in update function, something like
this._viewElement.style.height = ((this.element.offsetHeight + SCROLLBAR_WIDTH).toString() + 'px'); this._viewElement.style.width = ((this.element.offsetWidth + SCROLLBAR_WIDTH).toString() + 'px'); const needY = this.element.offsetHeight < this._viewElement.scrollHeight; const needX = this.element.offsetWidth < this._viewElement.scrollWidth; if (needY){ if (!this.needY) this._scrollbarVerticalElement.style.display = ''; //here all thumb size calculation }else if (this.needY){ this._scrollbarVerticalElement.style.display = 'none'; } this.needY = needY //samething for needX if (needX || needY) this._scrollHandler(); return this;
in update function, something like