简体   繁体   English

focusOut、input 的 IE11 事件触发问题

[英]IE11 event trigger issue for focusOut, input

I have an input text box on which there are handlers for events like focusOut, input我有一个输入文本框,上面有事件处理程序,如 focusOut、input

Now, I expect the "input" event to be trigerred/handled first and then the "focusOut" (as I use the entered value in focusOut)现在,我希望首先触发/处理“输入”事件,然后是“focusOut”(因为我在 focusOut 中使用输入的值)

The above sequence works consistently on Chrome, FF.上述序列在 Chrome, FF 上始终有效。 However, in IE11, the sequence is a bit unpredictable ie in certain cases, the focusOut triggers first and then the input然而,在 IE11 中,序列有点不可预测,即在某些情况下,focusOut 先触发,然后输入

From what I observed, this is mostly when I enter the value in that field and directly click on the Submit btn on my form using my mouse.根据我的观察,这主要是当我在该字段中输入值并使用鼠标直接单击表单上的提交 btn 时。 Is that a known IE11 issue ?这是一个已知的 IE11 问题吗?

Looks like you are saying that onfocusout is executing first then oninput event.看起来您是在说 onfocusout 首先执行,然后是 oninput 事件。

I try to test this sample code with IE browser and it looks fine.我尝试使用 IE 浏览器测试此示例代码,它看起来不错。

 <!doctype html> <html> <head> </head> <body> <input type="text" id="input" onfocusout="alert(this.value)"> oninput: <span id="result"></span><br> <input type="submit" value="submit"> <script> input.oninput = function() { result.innerHTML = input.value; }; </script> </body> </html>

Output:输出:

在此处输入图片说明

Let me know if I am missing anything.如果我遗漏了什么,请告诉我。 I will try to correct myself.我会努力纠正自己。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM