NetherGranite
NetherGranite

Reputation: 2100

How to approach debugging IE11 firing oninput inappropriately on only my web page

I have a textbox:

<input id="someTextbox" type="text" oninput="console.log('input')">

And in IE11, "input" will be printed when the textbox has no input and gains or loses focus. This does not happen in any other browsers, and I cannot reproduce it simply, so I assume some outside interference is causing this.

How would I ideally debug this?

I should mention that this textbox has the full definition

<input type="text"
    id="someTextbox" class="form-control"
    oninput="console.log('input')"
    placeholder="Type here" aria-label="Type here"
>

where .form-control is a Bootstrap CSS class.

Upvotes: 0

Views: 57

Answers (1)

Yu Zhou
Yu Zhou

Reputation: 12999

The issue is related to the placeholder. It has nothing to do with the JavaScript, jQuery or Bootstrap you use. We can reproduce the issue with only the code below:

<input id="someTextbox" type="text" oninput="console.log('input')" placeholder="Type here">

It seems a known bug in IE. As a workaround, you could use onkeyup instead of oninput in IE.

Upvotes: 1

Related Questions