@onesy/ui-react 1.0.137 → 1.0.139

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.
@@ -216,22 +216,29 @@ const TableCell = /*#__PURE__*/_react.default.forwardRef((props_, ref) => {
216
216
  _react.default.useEffect(() => {
217
217
  if (sticky) {
218
218
  if (root) {
219
+ let offsetOriginal = root.offsetLeft;
219
220
  const parentOverflow = (0, _utils2.getOverflowParent)(root.parentElement, false);
220
221
  root.style.position = 'unset';
221
- const offsetOriginal = root.offsetLeft;
222
+ offsetOriginal = root.offsetLeft;
222
223
  root.style.position = 'sticky';
223
224
  const method = () => {
224
225
  const offsetNew = root.offsetLeft;
225
226
  setStickyActive(offsetOriginal !== offsetNew);
226
227
  };
228
+
229
+ // initial
230
+ method();
231
+ setTimeout(() => {
232
+ root.style.position = 'unset';
233
+ offsetOriginal = root.offsetLeft;
234
+ root.style.position = 'sticky';
235
+ method();
236
+ }, 150);
227
237
  if (parentOverflow) {
228
238
  parentOverflow.addEventListener('scroll', method, {
229
239
  passive: false
230
240
  });
231
241
  }
232
-
233
- // initial
234
- method();
235
242
  return () => {
236
243
  if (parentOverflow) parentOverflow.removeEventListener('scroll', method);
237
244
  };
@@ -193,22 +193,29 @@ const TableCell = /*#__PURE__*/React.forwardRef((props_, ref) => {
193
193
  React.useEffect(() => {
194
194
  if (sticky) {
195
195
  if (root) {
196
+ let offsetOriginal = root.offsetLeft;
196
197
  const parentOverflow = getOverflowParent(root.parentElement, false);
197
198
  root.style.position = 'unset';
198
- const offsetOriginal = root.offsetLeft;
199
+ offsetOriginal = root.offsetLeft;
199
200
  root.style.position = 'sticky';
200
201
  const method = () => {
201
202
  const offsetNew = root.offsetLeft;
202
203
  setStickyActive(offsetOriginal !== offsetNew);
203
204
  };
205
+
206
+ // initial
207
+ method();
208
+ setTimeout(() => {
209
+ root.style.position = 'unset';
210
+ offsetOriginal = root.offsetLeft;
211
+ root.style.position = 'sticky';
212
+ method();
213
+ }, 150);
204
214
  if (parentOverflow) {
205
215
  parentOverflow.addEventListener('scroll', method, {
206
216
  passive: false
207
217
  });
208
218
  }
209
-
210
- // initial
211
- method();
212
219
  return () => {
213
220
  if (parentOverflow) parentOverflow.removeEventListener('scroll', method);
214
221
  };
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license UiReact v1.0.136
1
+ /** @license UiReact v1.0.138
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license UiReact v1.0.136
1
+ /** @license UiReact v1.0.138
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onesy/ui-react",
3
- "version": "1.0.137",
3
+ "version": "1.0.139",
4
4
  "description": "UI for React",
5
5
  "repository": "https://github.com/onesy-me/onesy.git",
6
6
  "author": "Lazar Erić <lazareric1@proton.me>",