Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
741 views
in Technique[技术] by (71.8m points)

antd 的搜索框的options和onkeypress 事件冲突怎么解决

   <AutoComplete
                dropdownMatchSelectWidth={670}
                style={{
                    width: '720px'
                }}
                onKeyPress={keyupadditem}
                value={searchValue}
                options={options}
                onSelect={onSelect}
                onChange={onChange}
                stopPagination={e => console.log(e)}
                placeholder="请输入关键词"
            >
            </AutoComplete>

必须按两次回车才可以执行回车里面的事件
把 options={options}去掉后就正常了
按回车看立刻执行


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...