@startlibs/components 1.0.5 → 1.0.6

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.
Files changed (2) hide show
  1. package/lib/index.js +6 -0
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -1376,6 +1376,9 @@ var usePositioning = function usePositioning(element, _ref, arrowRefOpt) {
1376
1376
  }, 100);
1377
1377
  return;
1378
1378
  }
1379
+ // Limpar a largura para medir pode encurtar o conteúdo (itens deixam de quebrar linha)
1380
+ // e o browser corta o scrollTop; guarda para restaurar depois de reaplicar a largura.
1381
+ var previousScrollTop = element.current.scrollTop;
1379
1382
  if (keepWidth) {
1380
1383
  element.current.style.width = '';
1381
1384
  } else {
@@ -1505,6 +1508,9 @@ var usePositioning = function usePositioning(element, _ref, arrowRefOpt) {
1505
1508
  if (fixed) {
1506
1509
  element.current.style.position = 'fixed';
1507
1510
  }
1511
+ if (element.current.scrollTop !== previousScrollTop) {
1512
+ element.current.scrollTop = previousScrollTop;
1513
+ }
1508
1514
  };
1509
1515
  useLayoutEffect(_setPosition, [on]);
1510
1516
  useEffect(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startlibs/components",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Startlibs Components",
5
5
  "main": "lib/index.js",
6
6
  "sideEffects": false,