1

I have modal pop-up in which I have few controls like TextArea, Inputs , dropdowns, DatePickers...

When I click on textbox or datepickers, I am not able to see the cursor(but i can see the focus styles applied) in the controls to type something. For the rest it works fine.. If I use tab key or shift+tab from other controls, then even in inputs I am able to see cursor and type..

This issue is only in IE. It works fine in FF and Chrome...

I have no clue what's going on. Please help me with a workaround or solution...

user2486535
  • 428
  • 1
  • 5
  • 21

1 Answers1

3

I recently stumbled upon the same or a very similar problem.

My site had two modal windows. After closing one modal window and then opening the next one, all text inputs on that one were not usable. When I clicked on an input, it changed its state to focus (CSS styles showed that) but there was no cursor and I was not able to type anything in. It was however possible to focus it manually using jQuery.

After hours of struggle I found this and this.

If an element has focus on it but is removed from the DOM (e.g. closing a modal window), IE is not able to put this focus on other elements.

This is what helped me:

modalWindowDiv.innerHTML = "";
$('#modalWindowDiv').remove();

or

$('#modalWindowDiv').empty().remove();

Just delete the contents of a modal window before removing it from the DOM. That should correctly remove any focus from it.

Community
  • 1
  • 1
arkuuu
  • 619
  • 7
  • 23