@thecb/components 6.0.0-beta.7 → 6.0.0-beta.8
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/package.json
CHANGED
|
@@ -122,6 +122,7 @@ const Dropdown = ({
|
|
|
122
122
|
value ? options.find(option => option.value === value)?.text : placeholder;
|
|
123
123
|
|
|
124
124
|
const onKeyDown = e => {
|
|
125
|
+
console.log("key down event is", e);
|
|
125
126
|
const { key, keyCode } = e;
|
|
126
127
|
const focus = document.activeElement;
|
|
127
128
|
console.log("dropdown value is", value);
|
|
@@ -183,13 +184,14 @@ const Dropdown = ({
|
|
|
183
184
|
};
|
|
184
185
|
|
|
185
186
|
useEffect(() => {
|
|
187
|
+
console.log("option refs in isopen useffect", optionRefs);
|
|
186
188
|
console.log(
|
|
187
|
-
"option
|
|
189
|
+
"option ref current in isopen useffect",
|
|
188
190
|
optionRefs.current[0].current
|
|
189
191
|
);
|
|
190
192
|
console.log("selected refs in isopen useffect", selectedRef);
|
|
191
193
|
console.log("value in isopen useffect", value);
|
|
192
|
-
if (isOpen && selectedRef !== undefined) {
|
|
194
|
+
if (isOpen && selectedRef !== undefined && selectedRef.current !== null) {
|
|
193
195
|
// WAI-ARIA requires the selected option to receive focus
|
|
194
196
|
selectedRef.current.focus();
|
|
195
197
|
} else if (isOpen && optionRefs.current[0].current) {
|
|
@@ -203,7 +205,7 @@ const Dropdown = ({
|
|
|
203
205
|
useEffect(() => {
|
|
204
206
|
if (autoEraseTypeAhead) {
|
|
205
207
|
clearTimeout(timer);
|
|
206
|
-
setTimer(setTimeout(() => setInputValue(""),
|
|
208
|
+
setTimer(setTimeout(() => setInputValue(""), 3000));
|
|
207
209
|
}
|
|
208
210
|
setFilteredOptions(
|
|
209
211
|
options.filter(
|
|
@@ -285,7 +287,9 @@ const Dropdown = ({
|
|
|
285
287
|
aria-label={getSelection()}
|
|
286
288
|
placeholder={getSelection()}
|
|
287
289
|
value={inputValue}
|
|
288
|
-
onChange={
|
|
290
|
+
onChange={e => {
|
|
291
|
+
console.log("input change event", e);
|
|
292
|
+
}}
|
|
289
293
|
themeValues={themeValues}
|
|
290
294
|
role="searchbox"
|
|
291
295
|
type="text"
|