@gustavo-valsechi/client 1.4.139 → 1.4.140

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.
@@ -74,12 +74,12 @@ function InputSelect(props) {
74
74
  return () => target.remove(inputRef);
75
75
  }, [containerRef, inputRef]);
76
76
  const onBlur = (event) => {
77
- setFocus(false);
78
77
  setFilter("");
78
+ setTimeout(() => setFocus(false), 1);
79
79
  if (register.onBlur) register.onBlur(event);
80
80
  };
81
81
  const onFocus = (event) => {
82
- setFocus(true);
82
+ setTimeout(() => setFocus(true), 1);
83
83
  if (register.onFocus) register.onFocus(event);
84
84
  };
85
85
  const onChange = (event) => {
@@ -131,7 +131,11 @@ function InputSelect(props) {
131
131
  {
132
132
  className: "input-icon",
133
133
  "data-focus": focus,
134
- onClick: () => inputRef.current.click(),
134
+ onClick: () => {
135
+ console.log(focus);
136
+ if (focus) return;
137
+ inputRef.current.focus();
138
+ },
135
139
  children: [
136
140
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { "aria-hidden": true, className: "fa-solid fa-chevron-up" }),
137
141
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { "aria-hidden": true, className: "fa-solid fa-chevron-down" })
@@ -41,12 +41,12 @@ function InputSelect(props) {
41
41
  return () => target.remove(inputRef);
42
42
  }, [containerRef, inputRef]);
43
43
  const onBlur = (event) => {
44
- setFocus(false);
45
44
  setFilter("");
45
+ setTimeout(() => setFocus(false), 1);
46
46
  if (register.onBlur) register.onBlur(event);
47
47
  };
48
48
  const onFocus = (event) => {
49
- setFocus(true);
49
+ setTimeout(() => setFocus(true), 1);
50
50
  if (register.onFocus) register.onFocus(event);
51
51
  };
52
52
  const onChange = (event) => {
@@ -98,7 +98,11 @@ function InputSelect(props) {
98
98
  {
99
99
  className: "input-icon",
100
100
  "data-focus": focus,
101
- onClick: () => inputRef.current.click(),
101
+ onClick: () => {
102
+ console.log(focus);
103
+ if (focus) return;
104
+ inputRef.current.focus();
105
+ },
102
106
  children: [
103
107
  /* @__PURE__ */ jsx("i", { "aria-hidden": true, className: "fa-solid fa-chevron-up" }),
104
108
  /* @__PURE__ */ jsx("i", { "aria-hidden": true, className: "fa-solid fa-chevron-down" })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/client",
3
- "version": "1.4.139",
3
+ "version": "1.4.140",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",