我正在使用Material UI v1.0.0-beta23以及redux-form和redux-form-material-ui.我有一个类型编号的字段,我想在标签上设置最小值和最大值.我已经尝试了inputProps和min/max,似乎都没有做我想要的.我查看了源代码,但没有看到明显的方法.是否可能,如果可能,怎么样?
这是我的JSX展示我尝试过的东西.
<Field
name="maxNodeSelectedCount"
component={TextField}
label="Max Node Selected Count"
type="number"
inputProps={{ min: 0, max: 10 }}
min={11}
max={20}
format={formatOption}
normalize={normalizeOption}
{...propertyFieldDefaults}
/>
Run Code Online (Sandbox Code Playgroud)
这是DOM的样子:
<input type="number" class="MuiInput-input-346 MuiInput-inputSingleline-349 MuiInput-inputDense-347" value="-3" name="options.maxNodeSelectedCount">
Run Code Online (Sandbox Code Playgroud) 我有一个对话框和一个 ListItem,当你点击它时,它会通过显示一个弹出框进入编辑模式。这是在使用 Modal 的旧版 MUI 中工作的,但自从获得最新版本后不起作用,我正在尝试使用 Popover。我试图在 CodeSandox 上做一个简单的例子,但行得通。发生的情况是 Popover 总是在页面的左上角而不是 ListItem。
我已经将我的代码简化为对话框中的一个简单的 Button 和 Popover,但仍然存在同样的问题,并且对接下来要尝试的内容没有想法。我在控制台中得到的错误是
[Warning] Material-UI: the `anchorEl` prop provided to the component is invalid.
The anchor element should be part of the document layout.
Make sure the element is present in the document or that it's not display none.
Run Code Online (Sandbox Code Playgroud)
单击该项目时,我会像示例中一样执行 event.currentTarget,这就是 console.log 的样子。
[Log] <button class="MuiButtonBase-root MuiButton-root MuiButton-text" tabindex="0" type="button"> (main.chunk.js, line 26437)
<span class="MuiButton-label">Click Me</span>
<span class="MuiTouchRipple-root">
<span class="MuiTouchRipple-ripple MuiTouchRipple-rippleVisible" style="width: 117.2006825918689px; height: 117.2006825918689px; top: -34.60034129593445px; …Run Code Online (Sandbox Code Playgroud)