English 中文(简体)
• 如何使MUI选择部分的关键选择成为可能?
原标题:How to enable keyboard selections in a MUI Select component?

我愿通过把钥匙板打入钥匙板,使用一个MUI选择性部件,然后将我所要选择的选项的第一封信封放在一边,然后把从该信开始的清单上的第一个项目自动上,而实际上却不开放选定名单。 同一封信的后几封主要新闻应通过从该信起的其余选择进行循环。 然后,用不同的钥匙开始程序,选择从该信开始的名单上的第一个项目。

我尚未在APIC中找到如何促成这种行为的财产,也没有这方面的任何实例。 请注意,我确实在文件here上看到了这一行为,但我要使用选编的正常版本。

Below is the code I have so far along with a link to a Code Sandbox for it.

import * as React from "react";
import {
  FormControl,
  InputLabel,
  Select,
  SelectChangeEvent,
  MenuItem,
  Box
} from "@mui/material";

export default function App() {
  const [partOfSpeech, setPartOfSpeech] = React.useState("");

  const handleChange = (event: SelectChangeEvent) => {
    setPartOfSpeech(event.target.value as string);
  };

  return (
    <Box sx={{ maxWidth: 200 }}>
      <FormControl fullWidth>
        <InputLabel id="demo-simple-select-label">Part of Speech</InputLabel>
        <Select
          labelId="demo-simple-select-label"
          id="demo-simple-select"
          value={partOfSpeech}
          label="Part of Speech"
          onChange={handleChange}
        >
          <MenuItem value="">none</MenuItem>
          <MenuItem value="adjective">adjective</MenuItem>
          <MenuItem value="noun">noun</MenuItem>
          <MenuItem value="adverb">adverb</MenuItem>
          <MenuItem value="verb">verb</MenuItem>
        </Select>
      </FormControl>
    </Box>
  );
}

Code Sandbox

我咨询了以下国际调查小组的参考资料,但找不到任何资料说明如何实现这一行为:

问题回答

use NativeSelect instead of Select





相关问题
How to use one react app into another react app?

I have two react apps, parent app and child app. and child app have an hash router. I have build the child app using npm run build, It creates build folder. That build folder moved into inside the ...

how to get selected value in Ant Design

I want to print the selected value, and below is my option list: const vesselName = [ { value: 0 , label: ALBIDDA , }, { value: 1 , label: ALRUMEILA , }, { value: 2 ,...

How to add a <br> tag in reactjs between two strings?

I am using react. I want to add a line break <br> between strings No results and Please try another search term. . I have tried No results.<br>Please try another search term. but ...

热门标签