@gustavo-valsechi/client 1.4.92 → 1.4.94

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.
@@ -46,9 +46,10 @@ function InputSelect(props) {
46
46
  const [focus, setFocus] = (0, import_react.useState)(false);
47
47
  const register = (props.register || ((name) => ({})))(props.name || "");
48
48
  (0, import_react.useEffect)(() => {
49
+ if (!(inputRef == null ? void 0 : inputRef.current)) return;
49
50
  target.add({ ref: inputRef, component: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_options.default, { ...props, inputRef, register }) });
50
51
  return () => target.remove(inputRef);
51
- }, []);
52
+ }, [inputRef]);
52
53
  const onBlur = (event) => {
53
54
  setFocus(false);
54
55
  if (register.onBlur) register.onBlur(event);
@@ -13,9 +13,10 @@ function InputSelect(props) {
13
13
  const [focus, setFocus] = useState(false);
14
14
  const register = (props.register || ((name) => ({})))(props.name || "");
15
15
  useEffect(() => {
16
+ if (!(inputRef == null ? void 0 : inputRef.current)) return;
16
17
  target.add({ ref: inputRef, component: /* @__PURE__ */ jsx(InputSelectOption, { ...props, inputRef, register }) });
17
18
  return () => target.remove(inputRef);
18
- }, []);
19
+ }, [inputRef]);
19
20
  const onBlur = (event) => {
20
21
  setFocus(false);
21
22
  if (register.onBlur) register.onBlur(event);
@@ -104,7 +104,8 @@ const TargetProviderContainer = ({ children }) => {
104
104
  import_lodash.default.forEach(targets, (target, index) => {
105
105
  var _a;
106
106
  const element = (_a = target.ref) == null ? void 0 : _a.current;
107
- if (!element) return;
107
+ console.log(element);
108
+ if (!(element == null ? void 0 : element.addEventListener)) return;
108
109
  element.addEventListener("click", () => {
109
110
  const targetElement = import_lodash.default.find(containerRef.current, (data, i) => i === index);
110
111
  if (!targetElement) return;
@@ -70,7 +70,8 @@ const TargetProviderContainer = ({ children }) => {
70
70
  _.forEach(targets, (target, index) => {
71
71
  var _a;
72
72
  const element = (_a = target.ref) == null ? void 0 : _a.current;
73
- if (!element) return;
73
+ console.log(element);
74
+ if (!(element == null ? void 0 : element.addEventListener)) return;
74
75
  element.addEventListener("click", () => {
75
76
  const targetElement = _.find(containerRef.current, (data, i) => i === index);
76
77
  if (!targetElement) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/client",
3
- "version": "1.4.92",
3
+ "version": "1.4.94",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",