javascript - 在材质ui选择中添加文本框
问题描述
我正在尝试在材料 ui 选择选项中添加一个文本框,但是在更改文本框中的文本时,我想停止键导航,因为在按下字母键时,它正在导航到以该字母开头的选项这是我正在尝试的代码和图片达到
<Select
className={className}
style={style}
open={open}
value={value}
error={error}
onChange={props.onChange}
labelWidth={labelWidth}
autoWidth={true}
disabled={disabled}
inputProps={{ helperText: helperText }}
MenuProps={{
classes: {
root: "menu-item"
}
}}
classes={{
disabled: 'editable',
select: 'selected-item'
}}
>
{
<form>
<TextField
style={{ width: "150px" }}
onChange={(event) => handleChange(event)}
error={validation.isTextInValid}
onClick={
event => {
event.stopPropagation();
}
}
value={text}
label="Add New"
InputProps={{
endAdornment: (
<InputAdornment>
<div className="d-flex">
<IconButton
type="submit"
size="sm"
onClick={event => {
event.stopPropagation();
add()
}}
>
<i className="fa fa-plus"></i>
</IconButton>
</div>
</InputAdornment>
),
}}
/>
</form>
}
{props.children}
</Select>
解决方案
推荐阅读
- python - 计算字符串中多个元素的更好方法
- reactjs - 抽屉导航器的透明标题 - 反应导航5
- reactjs - Heroku 错误:找不到模块:错误:无法解析 '.../src/main/js/components 中的 'React'
- c - 限制进程写入自己的内存
- python-3.x - 调整值以微调预训练模型时出错
- c++ - 从 C++ 中的字符串引用变量
- html - 未知的 CSS 出现在 Fieldset
- ruby - 那是没有关于美丽jekyll修改的更新
- javascript - 当我更新它所在的 contenteditable div 的 innerHTML 时,如何保持插入符号的位置?
- javascript - 使用忽略特殊 RegEx 子字符串的拆分字符串