在React中编辑后如何显示自动完成值?

我有一个自动填充的城市,在“编辑模式”下,在编辑模式后我无法在输入中显示它,但从数据库中获取后,它仍处于状态

    <div className="form-group row">
        <div className="col-md-4  col-sm-10">
            <label htmlFor="inputCity" className="d-flex align-items-right mt-3">עיר</label>
            <Autocomplete
                id="combo-box-demo"
                disableClearable={true}
                wrapperStyle={{ position: 'relative', display: 'inline-block', color: 'red' }}
                options={cities}
                getOptionLabel={(city) => city.name}
                onSelect={this.onChangeHandler}
                noOptionsText={'ישוב לא קיים'}
                style={{ direction: 'rtl' }}
                renderInput={(params) => <TextField autocomplete="on" {...params} size='small' className="form-control" variant="outlined" name="companycity" placeholder="יישוב" value={this.state.signUpData.companycity} onChange={this.onChangeHandler} />}
            />
        </div>
    </div>
评论