Topic: checked not working. doesnt change state.

Ali Naiemabadi free asked 4 years ago


let deliveryTimeTable = [];

            response.data.deliveryTimes.map((prod, index) => {

                return deliveryTimeTable.push(
                    <Fragment key={index}>

                        <span className={classes.subtitles}>{prod.deliveryTitle}</span>

                        <MDBFormInline key={"frm." + index}>

                            {prod.deliveryTimeList.map(proditem => {
                                return <MDBInput
                                    onClick={() => this.deliveryHandler(proditem.deliveryTimeId)}
                                    checked={proditem.deliveryTimeId===this.state.deliverTime   ? true : false}
                                    label={proditem.deliveryTitle}
                                    labelClass='mr-5'
                                    type='radio'
                                    id={"delivery." + proditem.deliveryTimeId}
                                    key={"deliveryk." + proditem.deliveryTimeId}
                                />
                            })}
                        </MDBFormInline>
                    </Fragment>
                );
            });

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Closed

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.26.1
  • Device: Asus
  • Browser: chrome
  • OS: window 10
  • Provided sample code: No
  • Provided link: No