From 9797916db8a633e5b670ebe9921855b2ce54c454 Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Thu, 27 Apr 2023 17:36:22 +0200 Subject: [PATCH 1/7] maint(core dom): Simplify is_input method. --- src/core/dom.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/core/dom.js b/src/core/dom.js index f61c0f617..c0c901bd9 100644 --- a/src/core/dom.js +++ b/src/core/dom.js @@ -102,16 +102,11 @@ const is_visible = (el) => { /** * Test, if a element is a input-type element. * - * This is taken from Sizzle/jQuery at: - * https://github.com/jquery/sizzle/blob/f2a2412e5e8a5d9edf168ae3b6633ac8e6bd9f2e/src/sizzle.js#L139 - * https://github.com/jquery/sizzle/blob/f2a2412e5e8a5d9edf168ae3b6633ac8e6bd9f2e/src/sizzle.js#L1773 - * * @param {Node} el - The DOM node to test. * @returns {Boolean} - True if the element is a input-type element. */ const is_input = (el) => { - const re_input = /^(?:input|select|textarea|button)$/i; - return re_input.test(el.nodeName); + return el.matches("button, input, select, textarea"); }; /** From df89e023e3cfa78d5f5303ae4253dc044e3393ba Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Wed, 26 Apr 2023 23:25:32 +0200 Subject: [PATCH 2/7] maint(core registry): Simplify pattern scanning filter. --- src/core/registry.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/core/registry.js b/src/core/registry.js index 03fd0430c..02a85af9f 100644 --- a/src/core/registry.js +++ b/src/core/registry.js @@ -180,17 +180,16 @@ const registry = { ); matches = matches.filter((el) => { // Filter out patterns: - // - with class ``.disable-patterns`` - // - wrapped in ``.disable-patterns`` elements + // - with class ``.disable-patterns`` or wrapped within. // - wrapped in ``
`` elements
             // - wrapped in ``