Closed poinch closed 1 year ago
Thanks for raising this issue, i understood the rendering issue and will fix this in upcoming version
@danish1658 Thank you, appreciate it
I think I am also facing the same issue, not able to reset the dropdown to its initial and original view. I have a form after submitting I want to reset the dropdown to its original view. Please help by fixing this issue. Appreciate the work... Thanks in Advance.
@MohanNaidu69 Version 2.0 is ready , This issue has been resolved in new version , expect an update anytime soon
v2 is out now , see if issue is fixed , if not you can reopen this issue
Hi there,
i'll try to explain the issue i'm facing at the moment. I'm using the Select list in this way:
<SelectList data={dropDownBuyableGiftCards} setSelected={(id: string) => selectGiftCardAmountHandler(id)} placeholder="Scegli il valore" search={false} boxStyles={styles.dropdown} inputStyles={styles.dropdownText} dropdownStyles={styles.dropdownItemsContainer} dropdownTextStyles={styles.dropdownText} defaultOption={{ key: null, value: null }} />
where selectGiftCardAmountHandler it's a function that dispatch a action to a reducer:
const selectGiftCardAmountHandler = (id: string) => { const giftCardToBuy = buyableGiftCards.find((buyableGiftCard) => buyableGiftCard.id === id); dispatch(addGiftCardAmountToBuy({ id: giftCardToBuy.id, amount: giftCardToBuy.voucher.gift.amount })); };
Everything looks good, after the purchase of the gift card mentioned in my code i will go back to my home page and then if i go back to the gift card section the previous values are still selected BUT if i go back again and enter the gift card again the values will reset.
Looks like needs 2 re render to reset. I also have a:
useEffect(() => { (async () => { const buyableGiftCards = await getBuyableGiftCards(); dispatch(addBuyableGiftCards(buyableGiftCards)); })(); dispatch(resetGiftCardToBuy()); }, [giftcardToBuy]);
where resetGiftCardToBuy reset all my data selected but i don't think this will help.
Anyone could help please