当我开始在输入中输入某些内容(例如“te”)时,Microsoft Edge 会显示一个恼人的弹出窗口,其中包含文本“保存信息的结果”。我想隐藏它(对所有用户),所以我设置了 autocomplete=off
但我仍然看到这个烦人的框。我还尝试过 list="autocompleteOff"
并禁用所有扩展,但没有成功。
沙盒复制:https://codesandbox.io/s/hungry-golick-2fnlnt?file=/index.html
<input id="input-guess"
type="text"
bind:value={guess}
spellcheck="true"
placeholder={$t('common.enter_a_word')}
autocomplete="off"
list="autocompleteOff" />
最佳答案
我能够在自定义自动完成控件上重现此问题,并通过将 aria-autocomplete="both"aria-haspopup="false"
添加到我的输入字段来修复它:
您可以保留字段 ID 和其他属性autocomplete="off"pellcheck="false"
<input id="form-input-id" type="text" class="form-control" placeholder="Start typing" autocomplete="off" spellcheck="false" aria-autocomplete="both" aria-haspopup="false">
引用文献:
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-autocomplete
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-haspopup
关于html - 阻止 MS Edge 上的输入建议,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73348295/