ehscan-react-components 0.1.32 → 0.1.33
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.
- package/dist/TextAreaDropDown.js +11 -5
- package/package.json +1 -1
package/dist/TextAreaDropDown.js
CHANGED
|
@@ -98,13 +98,14 @@ export const TextAreaDropDown = ({ id, tabIndex, alwaysOpenDropDown, closeComman
|
|
|
98
98
|
useEffect(() => {
|
|
99
99
|
if (searchTerm === undefined)
|
|
100
100
|
return;
|
|
101
|
+
if (searchTerm !== "")
|
|
102
|
+
setOpenDropDown(true); //if closed on !alwaysOpenDropDown
|
|
101
103
|
if (dropdownValue.includes(searchTerm)) {
|
|
102
104
|
setNewBtn(false);
|
|
105
|
+
return;
|
|
103
106
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
setNewBtn(true);
|
|
107
|
-
}
|
|
107
|
+
if (searchTerm !== '')
|
|
108
|
+
setNewBtn(true);
|
|
108
109
|
}, [searchTerm]);
|
|
109
110
|
useEffect(() => {
|
|
110
111
|
if (!closeCommand)
|
|
@@ -112,7 +113,12 @@ export const TextAreaDropDown = ({ id, tabIndex, alwaysOpenDropDown, closeComman
|
|
|
112
113
|
setOpenDropDown(false);
|
|
113
114
|
}, [closeCommand]);
|
|
114
115
|
const focusInput = () => {
|
|
115
|
-
if (alwaysOpenDropDown
|
|
116
|
+
if (alwaysOpenDropDown) {
|
|
117
|
+
setOpenDropDown(true);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
console.log(searchTerm);
|
|
121
|
+
if (searchTerm) {
|
|
116
122
|
setOpenDropDown(true);
|
|
117
123
|
}
|
|
118
124
|
};
|