@gustavo-valsechi/client 1.4.135 → 1.4.137
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,6 +50,12 @@ function InputSelect(props) {
|
|
|
50
50
|
const register = (props.register || ((name) => ({})))(props.name || "");
|
|
51
51
|
const inputValue = (_a = props.watch) == null ? void 0 : _a.call(props, props.name);
|
|
52
52
|
const value = ((_b = import_lodash.default.find(props.options, (option) => Object.keys(option)[0] === inputValue)) == null ? void 0 : _b[inputValue || ""]) || "";
|
|
53
|
+
(0, import_react.useEffect)(() => {
|
|
54
|
+
if (focus) return;
|
|
55
|
+
const optionsElement = document.getElementById("input-options");
|
|
56
|
+
if (!optionsElement) return;
|
|
57
|
+
optionsElement.setAttribute("value", "");
|
|
58
|
+
}, [focus]);
|
|
53
59
|
(0, import_react.useEffect)(() => {
|
|
54
60
|
var _a2;
|
|
55
61
|
if (!(inputRef == null ? void 0 : inputRef.current) || !(containerRef == null ? void 0 : containerRef.current)) return;
|
|
@@ -126,8 +132,9 @@ function InputSelect(props) {
|
|
|
126
132
|
className: "input-icon",
|
|
127
133
|
"data-focus": focus,
|
|
128
134
|
onClick: () => {
|
|
135
|
+
console.log(focus);
|
|
129
136
|
if (focus) return;
|
|
130
|
-
inputRef.current.
|
|
137
|
+
inputRef.current.focus();
|
|
131
138
|
},
|
|
132
139
|
children: [
|
|
133
140
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { "aria-hidden": true, className: "fa-solid fa-chevron-up" }),
|
|
@@ -17,6 +17,12 @@ function InputSelect(props) {
|
|
|
17
17
|
const register = (props.register || ((name) => ({})))(props.name || "");
|
|
18
18
|
const inputValue = (_a = props.watch) == null ? void 0 : _a.call(props, props.name);
|
|
19
19
|
const value = ((_b = _.find(props.options, (option) => Object.keys(option)[0] === inputValue)) == null ? void 0 : _b[inputValue || ""]) || "";
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (focus) return;
|
|
22
|
+
const optionsElement = document.getElementById("input-options");
|
|
23
|
+
if (!optionsElement) return;
|
|
24
|
+
optionsElement.setAttribute("value", "");
|
|
25
|
+
}, [focus]);
|
|
20
26
|
useEffect(() => {
|
|
21
27
|
var _a2;
|
|
22
28
|
if (!(inputRef == null ? void 0 : inputRef.current) || !(containerRef == null ? void 0 : containerRef.current)) return;
|
|
@@ -93,8 +99,9 @@ function InputSelect(props) {
|
|
|
93
99
|
className: "input-icon",
|
|
94
100
|
"data-focus": focus,
|
|
95
101
|
onClick: () => {
|
|
102
|
+
console.log(focus);
|
|
96
103
|
if (focus) return;
|
|
97
|
-
inputRef.current.
|
|
104
|
+
inputRef.current.focus();
|
|
98
105
|
},
|
|
99
106
|
children: [
|
|
100
107
|
/* @__PURE__ */ jsx("i", { "aria-hidden": true, className: "fa-solid fa-chevron-up" }),
|