Opera 中的选择不会在更改事件时关闭
在 Opera 中(并且仅在 Opera 中)我有 select
元素的奇怪行为。 在更改事件中,如果我禁用此选择,它不会关闭(折叠)。
$('select').bind('change', function()
{
$(this).attr('disabled', true);
});
这是歌剧的一些已知问题吗?到目前为止我还没有发现任何东西。
In Opera (and only in Opera) I have strange behavior of select
element.
In change event, if I disable this select, it doesn't close (collapse).
$('select').bind('change', function()
{
$(this).attr('disabled', true);
});
Is it some known issue of opera? So far I haven't found anything.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
设置禁用属性对我不起作用,但此代码有效:
只需隐藏选择,一毫秒后显示它。
Setting disabled attribute did not work for me, but this code works:
Just hide select, and after one millisecond show it.
是的,这是 Opera 中的一个已知错误(如“Opera 软件知道它并正在致力于修复,但由于 Opera 的封闭错误跟踪器,世界上几乎没有其他人可以知道”“已知”的含义)。据我记得它甚至可能针对 Opera 12 进行修复,但我还没有仔细检查过。
对于解决方法,您可能只想保留它,因为未来的 Opera 版本中将提供修复,使用之前建议的超时也应该可以。
Yes, this is a known bug in Opera (as in the "Opera Software knows about it and is working on a fix, but pretty much nobody else in the world can tell because of Opera's closed bug tracker" meaning of "known"). As far as I remember it may even be fixed for Opera 12 but I haven't double-checked that.
For workarounds, you may want to just leave it since a fix is coming in a future Opera version, using a timeout as suggested earlier should work too.
在禁用选择之前使用短暂的延迟,10 毫秒就足够了
Use a short delay before disabling the select, 10ms should be sufficient