防止初始焦点
我有一个按钮,当它获得焦点时,它具有特殊的样式。
我有一个表单,其中只有一系列这些精美的按钮;当它加载时,该系列中的第一个按钮将显示特殊样式以指示它具有焦点。它的功能很好,但视觉上很烦人。
我已经解决了这个问题:
<TextBox width="1" Height="1" />
但这感觉像是一个拼凑。
有没有更好的方法来防止任何东西获得最初的焦点?
I have a button that, when it has focus, has a special style.
I have a form with only a series of these fancy buttons; when it loads, the first button in the series is displaying the special style to indicate it has focus. It's functionally fine, but visually annoying.
I have resolved this with:
<TextBox width="1" Height="1" />
But this feels like a kludge.
Is there a better way to prevent anything from having the initial focus?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,焦点应位于窗口而不是按钮上。您是否在不知不觉中使用焦点方法或选项卡索引将焦点设置在按钮上?
By default, focus should be on window and not on button. Are you unknowingly, setting focus on button either using focus method or tab index?