Skip to content

Commit 61953d8

Browse files
committed
maint(core registry): Simplify pattern scanning filter.
1 parent 5a833c8 commit 61953d8

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/core/registry.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,17 +180,16 @@ const registry = {
180180
);
181181
matches = matches.filter((el) => {
182182
// Filter out patterns:
183-
// - with class ``.disable-patterns``
184-
// - wrapped in ``.disable-patterns`` elements
183+
// - with class ``.disable-patterns`` or wrapped within.
185184
// - wrapped in ``<pre>`` elements
186185
// - wrapped in ``<template>`` elements
187186
return (
188-
!el.matches(".disable-patterns") &&
189-
!el?.parentNode?.closest?.(".disable-patterns") &&
187+
!el?.closest?.(".disable-patterns") &&
190188
!el?.parentNode?.closest?.("pre") &&
191-
!el?.parentNode?.closest?.("template") && // NOTE: not strictly necessary. Template is a DocumentFragment and not reachable except for IE.
192-
!el.matches(".cant-touch-this") && // BBB. TODO: Remove with next major version.
193-
!el?.parentNode?.closest?.(".cant-touch-this") // BBB. TODO: Remove with next major version.
189+
// BBB. TODO: Remove with next major version.
190+
!el?.closest?.(".cant-touch-this")
191+
// NOTE: templates are not reachabne anyways.
192+
//!el?.parentNode?.closest?.("template")
194193
);
195194
});
196195

0 commit comments

Comments
 (0)