javascript - Wrong activeElement in focus in IE11 -


in ie11 span element in focus state (document.activeelement returns span), element hasn't tabindex attribute , shouldn't in focus.

works fine in chrome , firefox (after click in focus div element tabindex attribute). problem in ie11. btw, cannot reproduce issue on jsbin.

example

http://i.stack.imgur.com/2qdmj.png

i don't see span in list of elements can focus.

is known problem? how make div tabindex activeelement after clicking on span?

http://msdn.microsoft.com/en-us/library/ms536934.aspx

finally found it's unexpected behavior in ie11 , possible bug if span has display: flex. chrome , firefox after click on span return div , ie returns span.

check snippet details. reported on caniuse , should added ie tracker.

document.getelementbyid('d').addeventlistener('click', function() {    alert('active element ' + document.activeelement);  });
#d {    display: flex;  }  span {    display: -ms-flex;    display: flex;  }
<div id='d' tabindex="1">    <div>      <span>span</span>    </div>  </div>


Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -