react-ui-basics 0.0.221 → 0.0.222
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FilteredList.css +1 -1
- package/Scrollable.js +7 -5
- package/Scrollable.js.map +1 -1
- package/bundle.css +618 -618
- package/package.json +1 -1
- package/src/FilteredList.css +1 -1
- package/src/FilteredList.scss +1 -1
- package/src/Scrollable.tsx +7 -5
package/package.json
CHANGED
package/src/FilteredList.css
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
background: white;
|
|
10
10
|
z-index: 4;
|
|
11
11
|
box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
|
|
12
|
-
transition:
|
|
12
|
+
transition: top 0.2s ease-out, opacity 0.2s ease-out;
|
|
13
13
|
top: calc(100% + 4px);
|
|
14
14
|
opacity: 0;
|
|
15
15
|
border-radius: 2px;
|
package/src/FilteredList.scss
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
background: white;
|
|
12
12
|
z-index: 4;
|
|
13
13
|
box-shadow: 0 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px 0 rgba(0, 0, 0, .14), 0 1px 5px 0 rgba(0, 0, 0, .12);
|
|
14
|
-
transition:
|
|
14
|
+
transition: top 0.2s ease-out, opacity 0.2s ease-out;
|
|
15
15
|
top: calc(100% + 4px);
|
|
16
16
|
opacity: 0;
|
|
17
17
|
border-radius: 2px;
|
package/src/Scrollable.tsx
CHANGED
|
@@ -274,14 +274,16 @@ class Scrollable extends AbstractScrollable {
|
|
|
274
274
|
!adjustedScrollWidth && adjustScrollWidth();
|
|
275
275
|
|
|
276
276
|
const newRatio = scrollHeight / scrollbarHeight;
|
|
277
|
-
if (
|
|
277
|
+
if ((ratio === newRatio && Number.isFinite(newRatio)) || Number.isNaN(newRatio)) return;
|
|
278
278
|
|
|
279
279
|
const offsetHeight = offsetHeightOf(viewport);
|
|
280
280
|
const horizontalScrollBarOffset = statusH() !== WITHOUT_SCROLL ? scrollbarH.clientHeight + Math.max(NATIVE_SCROLL_HEIGHT, 0) : 0;
|
|
281
281
|
|
|
282
282
|
let containerOffsetHeight = containerHeight + horizontalScrollBarOffset;
|
|
283
|
-
if (containerOffsetHeight === scrollHeight && status() === WITHOUT_SCROLL)
|
|
283
|
+
if (containerOffsetHeight === scrollHeight && status() === WITHOUT_SCROLL) {
|
|
284
|
+
ratio = newRatio;
|
|
284
285
|
return;
|
|
286
|
+
}
|
|
285
287
|
|
|
286
288
|
if (props().autoScrollTop && scrollHeight - offsetHeight - viewport.scrollTop <= 20 && newRatio < ratio && Number.isFinite(newRatio) && Number.isFinite(ratio)) {
|
|
287
289
|
viewport.scrollTop = 0; // scroll to top if scrollbar gets smaller
|
|
@@ -323,16 +325,16 @@ class Scrollable extends AbstractScrollable {
|
|
|
323
325
|
!adjustedScrollWidth && adjustScrollWidth();
|
|
324
326
|
|
|
325
327
|
const newRatio = scrollWidth / scrollbarWidth;
|
|
326
|
-
if (
|
|
328
|
+
if ((ratioH === newRatio && Number.isFinite(newRatio)) || Number.isNaN(newRatio)) return;
|
|
327
329
|
|
|
328
330
|
const offsetWidth = offsetWidthOf(viewport);
|
|
329
331
|
const verticalScrollBarOffset = status() !== WITHOUT_SCROLL ? scrollbar.clientWidth + Math.max(NATIVE_SCROLL_WIDTH, 0) : 0;
|
|
330
332
|
|
|
333
|
+
ratioH = newRatio;
|
|
331
334
|
let containerOffsetWidth = containerWidth + verticalScrollBarOffset;
|
|
332
335
|
if (containerOffsetWidth === scrollWidth && statusH() === WITHOUT_SCROLL)
|
|
333
336
|
return;
|
|
334
337
|
|
|
335
|
-
ratioH = newRatio;
|
|
336
338
|
if (newRatio > 1.02)
|
|
337
339
|
styleOf(thumbH).width = (scrollbarWidth / newRatio) + 'px';
|
|
338
340
|
|
|
@@ -373,7 +375,7 @@ class Scrollable extends AbstractScrollable {
|
|
|
373
375
|
|
|
374
376
|
if (update) {
|
|
375
377
|
initTimeout = setTimeout(() => {
|
|
376
|
-
resizeInterval = setInterval(update,
|
|
378
|
+
resizeInterval = setInterval(update, 16);
|
|
377
379
|
}, 200)
|
|
378
380
|
}
|
|
379
381
|
};
|