mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-05-22 13:54:08 +03:00
fix scrollMax overflow bug in new Firefox
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
* OverlayScrollbars
|
||||
* https://github.com/KingSora/OverlayScrollbars
|
||||
*
|
||||
* Version: 1.10.0
|
||||
* Version: 1.10.1
|
||||
*
|
||||
* Copyright KingSora | Rene Haas.
|
||||
* https://github.com/KingSora
|
||||
*
|
||||
* Released under the MIT license.
|
||||
* Date: 11.10.2019
|
||||
* Date: 30.12.2019
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
@@ -2,13 +2,13 @@
|
||||
* OverlayScrollbars
|
||||
* https://github.com/KingSora/OverlayScrollbars
|
||||
*
|
||||
* Version: 1.10.0
|
||||
* Version: 1.10.1
|
||||
*
|
||||
* Copyright KingSora | Rene Haas.
|
||||
* https://github.com/KingSora
|
||||
*
|
||||
* Released under the MIT license.
|
||||
* Date: 11.10.2019
|
||||
* Date: 30.12.2019
|
||||
*/
|
||||
|
||||
(function (global, factory) {
|
||||
@@ -3772,13 +3772,14 @@
|
||||
var xy = scrollbarVars._x_y;
|
||||
var wh = scrollbarVars._w_h;
|
||||
var widthHeight = scrollbarVars._width_height;
|
||||
var scrollMax = _strScroll + scrollbarVars._Left_Top + 'Max';
|
||||
var scrollMax = _strScroll + scrollbarVars._Left_Top + 'Max';
|
||||
var fractionalOverflowAmount = viewportRect[widthHeight] ? MATH.abs(viewportRect[widthHeight] - _viewportSize[wh]) : 0;
|
||||
var checkFractionalOverflowAmount = previousOverflowAmount && previousOverflowAmount[xy] > 0 && _viewportElementNative[scrollMax] === 0;
|
||||
overflowBehaviorIsVS[xy] = overflowBehavior[xy] === 'v-s';
|
||||
overflowBehaviorIsVH[xy] = overflowBehavior[xy] === 'v-h';
|
||||
overflowBehaviorIsS[xy] = overflowBehavior[xy] === 's';
|
||||
overflowAmount[xy] = MATH.max(0, MATH.round((contentScrollSize[wh] - _viewportSize[wh]) * 100) / 100);
|
||||
overflowAmount[xy] *= (hideOverflowForceTextarea || (_viewportElementNative[scrollMax] === 0 && fractionalOverflowAmount > 0 && fractionalOverflowAmount < 1)) ? 0 : 1;
|
||||
overflowAmount[xy] *= (hideOverflowForceTextarea || (checkFractionalOverflowAmount && fractionalOverflowAmount > 0 && fractionalOverflowAmount < 1)) ? 0 : 1;
|
||||
hasOverflow[xy] = overflowAmount[xy] > 0;
|
||||
|
||||
//hideOverflow:
|
||||
|
||||
Vendored
+3
-3
File diff suppressed because one or more lines are too long
@@ -2,13 +2,13 @@
|
||||
* OverlayScrollbars
|
||||
* https://github.com/KingSora/OverlayScrollbars
|
||||
*
|
||||
* Version: 1.10.0
|
||||
* Version: 1.10.1
|
||||
*
|
||||
* Copyright KingSora | Rene Haas.
|
||||
* https://github.com/KingSora
|
||||
*
|
||||
* Released under the MIT license.
|
||||
* Date: 11.10.2019
|
||||
* Date: 30.12.2019
|
||||
*/
|
||||
|
||||
(function (global, factory) {
|
||||
@@ -2674,7 +2674,7 @@
|
||||
_hostSizeCache = hostSize;
|
||||
|
||||
var hideOverflowForceTextarea = _isTextarea && (_viewportSize.w === 0 || _viewportSize.h === 0);
|
||||
var previousOverflow = _overflowAmountCache;
|
||||
var previousOverflowAmount = _overflowAmountCache;
|
||||
var overflowBehaviorIsVS = { };
|
||||
var overflowBehaviorIsVH = { };
|
||||
var overflowBehaviorIsS = { };
|
||||
@@ -2690,13 +2690,14 @@
|
||||
var xy = scrollbarVars._x_y;
|
||||
var wh = scrollbarVars._w_h;
|
||||
var widthHeight = scrollbarVars._width_height;
|
||||
var scrollMax = _strScroll + scrollbarVars._Left_Top + 'Max';
|
||||
var scrollMax = _strScroll + scrollbarVars._Left_Top + 'Max';
|
||||
var fractionalOverflowAmount = viewportRect[widthHeight] ? MATH.abs(viewportRect[widthHeight] - _viewportSize[wh]) : 0;
|
||||
var checkFractionalOverflowAmount = previousOverflowAmount && previousOverflowAmount[xy] > 0 && _viewportElementNative[scrollMax] === 0;
|
||||
overflowBehaviorIsVS[xy] = overflowBehavior[xy] === 'v-s';
|
||||
overflowBehaviorIsVH[xy] = overflowBehavior[xy] === 'v-h';
|
||||
overflowBehaviorIsS[xy] = overflowBehavior[xy] === 's';
|
||||
overflowAmount[xy] = MATH.max(0, MATH.round((contentScrollSize[wh] - _viewportSize[wh]) * 100) / 100);
|
||||
overflowAmount[xy] *= (hideOverflowForceTextarea || (_viewportElementNative[scrollMax] === 0 && fractionalOverflowAmount > 0 && fractionalOverflowAmount < 1)) ? 0 : 1;
|
||||
overflowAmount[xy] *= (hideOverflowForceTextarea || (checkFractionalOverflowAmount && fractionalOverflowAmount > 0 && fractionalOverflowAmount < 1)) ? 0 : 1;
|
||||
hasOverflow[xy] = overflowAmount[xy] > 0;
|
||||
|
||||
//hideOverflow:
|
||||
@@ -2915,7 +2916,7 @@
|
||||
var cursorIsLastPosition = (cursorPos >= cursorMax && _textareaHasFocus);
|
||||
var textareaScrollAmount = {
|
||||
x: (!textareaAutoWrapping && (cursorCol === lastCol && cursorRow === widestRow)) ? _overflowAmountCache.x : -1,
|
||||
y: (textareaAutoWrapping ? cursorIsLastPosition || textareaRowsChanged && (previousOverflow !== undefined ? (currScroll.y === previousOverflow.y) : false) : (cursorIsLastPosition || textareaRowsChanged) && cursorRow === lastRow) ? _overflowAmountCache.y : -1
|
||||
y: (textareaAutoWrapping ? cursorIsLastPosition || textareaRowsChanged && (previousOverflowAmount ? (currScroll.y === previousOverflowAmount.y) : false) : (cursorIsLastPosition || textareaRowsChanged) && cursorRow === lastRow) ? _overflowAmountCache.y : -1
|
||||
};
|
||||
currScroll.x = textareaScrollAmount.x > -1 ? (_isRTL && _normalizeRTLCache && _rtlScrollBehavior.i ? 0 : textareaScrollAmount.x) : currScroll.x; //if inverted, scroll to 0 -> normalized this means to max scroll offset.
|
||||
currScroll.y = textareaScrollAmount.y > -1 ? textareaScrollAmount.y : currScroll.y;
|
||||
|
||||
Vendored
+3
-3
File diff suppressed because one or more lines are too long
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "overlayscrollbars",
|
||||
"version": "1.9.1",
|
||||
"version": "1.10.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
Reference in New Issue
Block a user