@gustavo-valsechi/client 1.4.115 → 1.4.116

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.
@@ -43,7 +43,7 @@ function InputSelectOption(props) {
43
43
  var _a, _b;
44
44
  (_a = props.setValue) == null ? void 0 : _a.call(props, props.name, value);
45
45
  if (!value || !((_b = props.inputRef) == null ? void 0 : _b.current)) return;
46
- props.inputRef.current.blur();
46
+ props.inputRef.current.click();
47
47
  }, [value, props.inputRef]);
48
48
  (0, import_react.useEffect)(() => {
49
49
  const optionsElement = document.getElementById("input-options");
@@ -10,7 +10,7 @@ function InputSelectOption(props) {
10
10
  var _a, _b;
11
11
  (_a = props.setValue) == null ? void 0 : _a.call(props, props.name, value);
12
12
  if (!value || !((_b = props.inputRef) == null ? void 0 : _b.current)) return;
13
- props.inputRef.current.blur();
13
+ props.inputRef.current.click();
14
14
  }, [value, props.inputRef]);
15
15
  useEffect(() => {
16
16
  const optionsElement = document.getElementById("input-options");
@@ -130,7 +130,7 @@ const TargetProviderContainer = ({ children }) => {
130
130
  const getCoords = (target) => {
131
131
  const rect = target.getBoundingClientRect();
132
132
  const targetTop = rect.top + window.scrollY;
133
- const targetLeft = rect.left + window.scrollX + 1;
133
+ const targetLeft = rect.left + window.scrollX - 1;
134
134
  const coords = {
135
135
  top: targetTop + (target.offsetHeight + 5),
136
136
  left: targetLeft
@@ -168,12 +168,14 @@ const TargetProviderContainer = ({ children }) => {
168
168
  {
169
169
  ref: (element) => containerRef.current[index] = element,
170
170
  onMouseEnter: () => {
171
- insideMemory.push(index);
172
171
  elementFocusable(target, index).focus();
172
+ if (import_lodash.default.some(insideMemory, (i) => i === index)) return;
173
+ insideMemory.push(index);
173
174
  },
174
175
  onClick: () => {
175
- insideMemory.push(index);
176
176
  elementFocusable(target, index).focus();
177
+ if (import_lodash.default.some(insideMemory, (i) => i === index)) return;
178
+ insideMemory.push(index);
177
179
  },
178
180
  onMouseLeave: () => {
179
181
  insideMemory.splice(import_lodash.default.findIndex(insideMemory, (i) => i === index), 1);
@@ -96,7 +96,7 @@ const TargetProviderContainer = ({ children }) => {
96
96
  const getCoords = (target) => {
97
97
  const rect = target.getBoundingClientRect();
98
98
  const targetTop = rect.top + window.scrollY;
99
- const targetLeft = rect.left + window.scrollX + 1;
99
+ const targetLeft = rect.left + window.scrollX - 1;
100
100
  const coords = {
101
101
  top: targetTop + (target.offsetHeight + 5),
102
102
  left: targetLeft
@@ -134,12 +134,14 @@ const TargetProviderContainer = ({ children }) => {
134
134
  {
135
135
  ref: (element) => containerRef.current[index] = element,
136
136
  onMouseEnter: () => {
137
- insideMemory.push(index);
138
137
  elementFocusable(target, index).focus();
138
+ if (_.some(insideMemory, (i) => i === index)) return;
139
+ insideMemory.push(index);
139
140
  },
140
141
  onClick: () => {
141
- insideMemory.push(index);
142
142
  elementFocusable(target, index).focus();
143
+ if (_.some(insideMemory, (i) => i === index)) return;
144
+ insideMemory.push(index);
143
145
  },
144
146
  onMouseLeave: () => {
145
147
  insideMemory.splice(_.findIndex(insideMemory, (i) => i === index), 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/client",
3
- "version": "1.4.115",
3
+ "version": "1.4.116",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",