当用户输入的数字超过最大值时,如何禁用浏览器 popup/tooltip?

How to disable browser popup/tooltip when user exceeds max in a number input?

当用户手动输入超过最大值的数量时,如何禁用图像中的工具提示?

当用户尝试提交表单时会显示工具提示,我需要将其禁用。我很确定这是由浏览器生成的,而不是我正在使用的任何库。如果有人能证实这一点,我们将不胜感激。

我正在使用 material UI 和 React Hook 表单:

<Controller
    name={`quantity${sku}`}
    control={control}
    defaultValue={currentQuantity}
    render={({ onChange, onBlur }) => (
        <OutlinedInput
            defaultValue={currentQuantity}
            type="number"
            name={`quantity${sku}`}
            variant="outlined"
            onChange={e => {
                handleChange(e);
                onChange(e);
            }}
            onBlur={e => {
                handleChange(e);
                onBlur(e);
            }}
            inputProps={{
                maxLength: 2,
                max: maxQuantity || 99,
                min: 1
            }}
        />
    )}
/>
    

noValidate 属性将阻止验证

 <form noValidate>
    <input type="number" max="10" />
    <button>Submit</button>
  </form>