Below screen is showing one item and it’s available quantity. Assume that i have entered 5 value in the required quantity field. After clicking the Add More button, pop up will open which contains list of items. On clicking on any item in the list, calling an api to check the availablity of that item. If that item is available that particular item details will be added to the list. But the previous item’s required quantity will be null. I am storing the item’s details in app state.
For ex: Chair is item. Contains 9 as available quantity and i entered 5 as required quantity in the textfield. After that i’ll click on Add more button it will show a pop up which contains list of items. Assume i have clicked Table item. Table data will be added to the app state but in previous Chair item’s required field will be “null”.
[Item which already added to app state] (https://i.sstatic.net/CUv7oG0r.png)
List of items
when added table item, chair item’s required quantity has become null
I want the previous item required quantity has to displayed in screen.
user27460730 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.