IE11 textarea loses focus if another textarea is disabled

旧巷老猫 提交于 2019-12-24 03:24:20

问题


In this fiddle, using ie11 with open Console, input something into any textarea and then click into any other textarea. In console, you will see that change event for the first textarea is triggered, then this textarea gets disabled, but focus event for the second textarea is not triggered. Why?

In my case, I was able to achieve what I needed by using readonly instead of disabled, but generally this looks quite odd. A bug?

For input type=text it works as expected, for now I was able to reproduce it for textarea only.


回答1:


you need to put .focus() after disable textarea.

Please Check this I have update your fiddle



来源:https://stackoverflow.com/questions/30071404/ie11-textarea-loses-focus-if-another-textarea-is-disabled

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!