当用户使用键盘上的箭头键浏览选项时,我从突出显示的选项中获取值并将其用作当前输入值(此处的输入有其自己的状态)。
不幸的是,将选项的标题或值保存为输入后,选项的突出显示状态会丢失。有没有办法不丢失呢?
这是一个例子:
https://codesandbox.io/s/modern-rgb-5tew1p?file=/demo.tsx
PS:虽然这个属性听起来像是为此而设计的,但includeInputInList没有帮助。
提前致谢!
在我的 Next/React/Typescript/Jest 项目中,我尝试配置我的 eslint 配置。\n更新到版本 8.x(当前为 8.0.1)后,linter 抛出以下错误:
\nError: .eslintrc.js \xc2\xbb ./eslint/config.js:\n Environment key "jest/globals" is unknown\nRun Code Online (Sandbox Code Playgroud)\n然后我添加'plugin:jest/recommended'到extendsmy 中的数组config.js,这导致我出现此错误:
TypeError: Failed to load plugin 'jest' declared in '.eslintrc.js \xc2\xbb ./eslint/config.js': Class extends value undefined is not a constructor or null\nRun Code Online (Sandbox Code Playgroud)\n该插件已安装并位于我的package.json. 甚至有几个也npm ci没有帮助我。
将不胜感激!
\n