You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

MUI X Time Picker点击后占满屏幕,如何设置宽度?

求助:MUI TimePicker 结合 React Hook Form 使用异常

我已经查阅各类资料并尝试了所有能找到的解决方案,但均无效,望各位提供帮助。

截图:
时间选择器打开后的表现截图

我的代码如下:

<Controller
  name="startTime"
  control={control}
  rules={{ validate: validateTime }}
  render={({ field }) => (
    <TimePicker
      {...field}
      value={field?.value || null}
      format="HH:mm"
      name="startTime"
      ampm={false}
      minutesStep={15}
      label="24 hours"
      className="time-picker"
      slotProps={{
        textField: {
          sx: {
            borderRadius: 6,
            fieldset: { borderRadius: 6 },
            [`.${OutlinedInputClasses.root}`]: {
              height: 80,
              width: 300,
            },
            '& .MuiInputLabel-root': { lineHeight: 3 },
          },
        },
      }}
    />
  )}
/>;

内容的提问来源于stack exchange,提问作者Pat

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.29 23:24:50