javascript - IE | How to prevent input-focus missing on scrolling page? -


I have HTML form with many inputs. I am very happy in the situation when I have focused on input, after this I'm messing around the scrolling page and focus.

Issue: A focus element loses focus when IE scrollbar is used.

  • Identify the element to lose focus
  • Identify the document when it is scrolled
  • Re-apply the focus
  • You can identify the element which loses focus through the Blurring event. Add an appropriate event handler to each element where you keep meditation in mind Want to

    When Blurring event handler runs for any input element, you should store, perhaps global variable, an identifier for input element, how do you do it Depends on how you identify the element. The id of the element will be ideal.

    You can tell that when a document is scrolling through the scrolling view the window handler of the window.

    You can tell that when a scroll scrolling scroll was made by comparing the values ​​of the before and after.

    Overall:

    • Add Blurring event handlers to your input elements
    • On the stigma, note that element
    • Compare scrollwheat to determine if scrolling is stopped, during scrolling
    • Re-apply focus
    < / Li> P> You may stop waiting for a short time between scrolling and re-implementing the focus. The user is stopping a short, stopping, scrolling, stopping. You do not want your script to be the reason for the crazy focus hooping behavior.


    Comments