react-ui-basics 0.0.221 → 0.0.223

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-ui-basics",
3
- "version": "0.0.221",
3
+ "version": "0.0.223",
4
4
  "description": "",
5
5
  "module": "index.js",
6
6
  "_main": "index.cjs.js",
@@ -195,8 +195,6 @@ class DNDContainer extends Component<DNDContainerProps, DNDContainerState> {
195
195
  if (e.touches.length > 1)
196
196
  return;
197
197
 
198
- stopPropagation(e)
199
- preventDefault(e)
200
198
  dragged = dragStarted = false;
201
199
  const touch = e.targetTouches[0];
202
200
  longTouch = setTimeout(() => longTouch && (dragStarted = true) && (longTouch = dragStartListener(touch)), !handle ? 500 : 0)
@@ -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: all 0.2s ease-out;
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;
@@ -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: all 0.2s ease-out;
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;
@@ -274,14 +274,16 @@ class Scrollable extends AbstractScrollable {
274
274
  !adjustedScrollWidth && adjustScrollWidth();
275
275
 
276
276
  const newRatio = scrollHeight / scrollbarHeight;
277
- if (!containerHeight || (ratio === newRatio && Number.isFinite(newRatio)) || Number.isNaN(newRatio)) return;
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 (!containerWidth || (ratioH === newRatio && Number.isFinite(newRatio)) || Number.isNaN(newRatio)) return;
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, 50);
378
+ resizeInterval = setInterval(update, 16);
377
379
  }, 200)
378
380
  }
379
381
  };