@sheinx/hooks 3.6.0-beta.7 → 3.6.0-beta.8

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.
@@ -163,7 +163,7 @@ var usePositionStyle = exports.usePositionStyle = function usePositionStyle(conf
163
163
  var overRight = 0;
164
164
  var overLeft = 0;
165
165
  if (h === 'left') {
166
- style.left = rect.left - containerRect.left + containerScroll.left;
166
+ style.left = rect.left - containerRect.left + containerScroll.left - (offset ? offset[0] : 0);
167
167
  style.transform = '';
168
168
  arrayStyle.left = "8px";
169
169
  if (adjust) {
@@ -173,7 +173,7 @@ var usePositionStyle = exports.usePositionStyle = function usePositionStyle(conf
173
173
  }
174
174
  }
175
175
  } else if (h === 'right') {
176
- style.right = containerRect.right - rect.right + containerScrollBarWidth - containerScroll.left;
176
+ style.right = containerRect.right - rect.right + containerScrollBarWidth - containerScroll.left - (offset ? offset[0] : 0);
177
177
  style.left = 'auto';
178
178
  style.transform = '';
179
179
  arrayStyle.right = "8px";
@@ -154,7 +154,7 @@ export var usePositionStyle = function usePositionStyle(config) {
154
154
  var overRight = 0;
155
155
  var overLeft = 0;
156
156
  if (h === 'left') {
157
- style.left = rect.left - containerRect.left + containerScroll.left;
157
+ style.left = rect.left - containerRect.left + containerScroll.left - (offset ? offset[0] : 0);
158
158
  style.transform = '';
159
159
  arrayStyle.left = "8px";
160
160
  if (adjust) {
@@ -164,7 +164,7 @@ export var usePositionStyle = function usePositionStyle(config) {
164
164
  }
165
165
  }
166
166
  } else if (h === 'right') {
167
- style.right = containerRect.right - rect.right + containerScrollBarWidth - containerScroll.left;
167
+ style.right = containerRect.right - rect.right + containerScrollBarWidth - containerScroll.left - (offset ? offset[0] : 0);
168
168
  style.left = 'auto';
169
169
  style.transform = '';
170
170
  arrayStyle.right = "8px";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/hooks",
3
- "version": "3.6.0-beta.7",
3
+ "version": "3.6.0-beta.8",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",