@gustavo-valsechi/client 1.4.79 → 1.4.80

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.
@@ -50,7 +50,6 @@ const TargetProviderContainer = ({ children }) => {
50
50
  const element = (_a = target.ref) == null ? void 0 : _a.current;
51
51
  if (!element) return;
52
52
  element.addEventListener("click", () => {
53
- var _a2, _b;
54
53
  const targetElement = import_lodash.default.find(containerRef.current, (data, i) => i === index);
55
54
  if (!targetElement) return;
56
55
  console.log(index, "onClick");
@@ -64,10 +63,10 @@ const TargetProviderContainer = ({ children }) => {
64
63
  targetElement.style.left = `${coords.left}px`;
65
64
  targetElement.style.opacity = "1";
66
65
  targetElement.style.zIndex = "10";
67
- (_b = (_a2 = inputRef.current) == null ? void 0 : _a2[index]) == null ? void 0 : _b.focus();
66
+ inputRef.current[index].focus();
68
67
  });
69
68
  });
70
- }, [targets]);
69
+ }, [targets, inputRef, containerRef]);
71
70
  const getCoords = (target) => {
72
71
  const rect = target.getBoundingClientRect();
73
72
  const targetTop = rect.top + window.scrollY;
@@ -124,13 +123,12 @@ const TargetProviderContainer = ({ children }) => {
124
123
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
125
124
  "input",
126
125
  {
127
- hidden: true,
126
+ style: { zIndex: "-1", position: "fixed", opacity: "0" },
128
127
  ref: (element) => inputRef.current[index] = element,
129
128
  onBlur: () => {
130
- var _a;
131
129
  if (inside) return;
132
130
  console.log(index, "onBlur");
133
- (_a = containerRef.current[index]) == null ? void 0 : _a.click();
131
+ containerRef.current[index].click();
134
132
  },
135
133
  onFocus: () => {
136
134
  console.log(index, "onFocus");
@@ -16,7 +16,6 @@ const TargetProviderContainer = ({ children }) => {
16
16
  const element = (_a = target.ref) == null ? void 0 : _a.current;
17
17
  if (!element) return;
18
18
  element.addEventListener("click", () => {
19
- var _a2, _b;
20
19
  const targetElement = _.find(containerRef.current, (data, i) => i === index);
21
20
  if (!targetElement) return;
22
21
  console.log(index, "onClick");
@@ -30,10 +29,10 @@ const TargetProviderContainer = ({ children }) => {
30
29
  targetElement.style.left = `${coords.left}px`;
31
30
  targetElement.style.opacity = "1";
32
31
  targetElement.style.zIndex = "10";
33
- (_b = (_a2 = inputRef.current) == null ? void 0 : _a2[index]) == null ? void 0 : _b.focus();
32
+ inputRef.current[index].focus();
34
33
  });
35
34
  });
36
- }, [targets]);
35
+ }, [targets, inputRef, containerRef]);
37
36
  const getCoords = (target) => {
38
37
  const rect = target.getBoundingClientRect();
39
38
  const targetTop = rect.top + window.scrollY;
@@ -90,13 +89,12 @@ const TargetProviderContainer = ({ children }) => {
90
89
  /* @__PURE__ */ jsx(
91
90
  "input",
92
91
  {
93
- hidden: true,
92
+ style: { zIndex: "-1", position: "fixed", opacity: "0" },
94
93
  ref: (element) => inputRef.current[index] = element,
95
94
  onBlur: () => {
96
- var _a;
97
95
  if (inside) return;
98
96
  console.log(index, "onBlur");
99
- (_a = containerRef.current[index]) == null ? void 0 : _a.click();
97
+ containerRef.current[index].click();
100
98
  },
101
99
  onFocus: () => {
102
100
  console.log(index, "onFocus");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/client",
3
- "version": "1.4.79",
3
+ "version": "1.4.80",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",