From 413292df89ff3ab7307577c733f70e5d1aca83e8 Mon Sep 17 00:00:00 2001 From: 441858299 <441858299@qq.com> Date: Fri, 23 Jul 2021 16:27:07 +0800 Subject: [PATCH] Utils: fix initEvent need params error on IE --- src/utils/aria-utils.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/utils/aria-utils.js b/src/utils/aria-utils.js index aa8a4dd08..6d6b9459a 100644 --- a/src/utils/aria-utils.js +++ b/src/utils/aria-utils.js @@ -100,11 +100,10 @@ aria.Utils.triggerEvent = function(elm, name, ...opts) { } const evt = document.createEvent(eventName); - // evt.initEvent(name, ...opts); // fix initEvent need params error on IE - if (opts.length > 2) { + if (opts.length >= 2) { evt.initEvent(name, ...opts); - } else if (opts.length === 2) { + } else if (opts.length === 1) { evt.initEvent(name, ...[opts], false); } else { evt.initEvent(name, ...[false, false]);