nexxtway / react-rainbow

🌈 React Rainbow Components. Build your web application in a snap.
https://react-rainbow.io
MIT License
1.79k stars 112 forks source link

Lookup small with icon and description doesnt show spinner #2314

Open sayinmehmet47 opened 3 years ago

sayinmehmet47 commented 3 years ago

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. image

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 (

setState({ option })} onSearch={search} style={containerStyles} className="rainbow-m-vertical_x-large rainbow-p-horizontal_medium rainbow-m_auto" />

); }

sayinmehmet47 commented 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

LeandroTorresSicilia commented 3 years ago

@sayinmehmet47 what browser are you using? This is a bug since this component is intended to have only one x.

sayinmehmet47 commented 3 years ago

@LeandroTorresSicilia it is brave

LeandroTorresSicilia commented 3 years ago

@sayinmehmet47 to me it looks fine on brave, are you using windows OS?

sayinmehmet47 commented 3 years ago

@LeandroTorresSicilia windows 10 . so look at the app also in searchbar when search for currency https://currency-portfolio.netlify.app/