Open sayinmehmet47 opened 3 years ago
ok I solved it by adding
isLoading={state.isLoading}
to Lookup. But could not remove 'x' when searching. because two x icons appear when loading
@sayinmehmet47 what browser are you using? This is a bug since this component is intended to have only one x.
@LeandroTorresSicilia it is brave
@sayinmehmet47 to me it looks fine on brave, are you using windows OS?
@LeandroTorresSicilia windows 10 . so look at the app also in searchbar when search for currency https://currency-portfolio.netlify.app/
I document Lookup component have spinner while making search. I created the same component,like in document.But I can not see any spinner. I don't know if it is stem from className working or nor.
export default function SearchingComponent({ selection }) { console.log(selection); const [state, setState] = useState({ options: null });
useEffect(() => { selection(state.option ? state.option.label : null); }, [state]);
const IconStyles = { height: 30, width: 30, backgroundColor: "#01b6f5", borderRadius: 40, display: "flex", alignItems: "center", justifyContent: "center", color: "white", }; const containerStyles = { maxWidth: 700, }; const data = useSelector((state) => state.codes.data.map((e) => { return { label: e[0], description: {" "}
),
};
})
);
${e[0]}-${e[1]}
, icon: ( {" "}function filter(query, options) { if (query) { return options.filter((item) => { const regex = new RegExp(query, "i"); return regex.test(item.label); }); } return []; }
function search(value) { if (state.options && state.value && value.length > state.value.length) { setState({ options: filter(value, state.options), value, }); } else if (value) { setState({ isLoading: true, value, }); setTimeout( () => setState({ options: filter(value, data), isLoading: false, }), 500 ); } else { setState({ isLoading: false, value: "", options: null, }); } } return (
); }