anytime i make a click in the select-search scroll it closes, making it troubling for the user, but you can scoll with the wheel so it is actually working in some way, is there any solution to it?
in a file of useSelect.js in the onBlur callback i got a condition with a document.getElementById to know if it makes focus on the container or not, depending on the condition i update the focus from true to false and backwards, and even if it is a temporary solution, if i use more than 1 select it stops working.
this is the full code im using for this:
const onBlur = useCallback(() => {
window.addEventListener('click', function(e){
if (document.getElementById('selectSearchDebit').contains(e.target)){
//console.log("clic dentro del Debit")
} else{
setState((oldState) => ({
...oldState,
focus: false,
search: '',
flat: flatDefaultOptions,
highlighted: -1,
}));
//console.log("clic fuera del Debit")
}});
window.addEventListener('click', function(e){
if (document.getElementById('selectSearchCredit').contains(e.target)){
//console.log("clic dentro del Credit")
} else{
setState((oldState) => ({
...oldState,
focus: false,
search: '',
flat: flatDefaultOptions,
highlighted: -1,
}));
//console.log("clic fuera del Credit")
}
});
anytime i make a click in the select-search scroll it closes, making it troubling for the user, but you can scoll with the wheel so it is actually working in some way, is there any solution to it?
in a file of useSelect.js in the onBlur callback i got a condition with a document.getElementById to know if it makes focus on the container or not, depending on the condition i update the focus from true to false and backwards, and even if it is a temporary solution, if i use more than 1 select it stops working.
this is the full code im using for this: