Skip to content

Commit 885f42e

Browse files
authored
Merge pull request #4 from AliOsm/main
Fix directive cache poisoning from early attribute mutations
2 parents dac23f8 + 0008c10 commit 885f42e

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

dist/stimulus-x.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/stimulus-x.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/directives.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export function directives(el, attributes) {
2626
directives = el.__stimulusX_directives;
2727
} else {
2828
directives = Array.from(attributes).filter(isDirectiveAttribute).map(toParsedDirectives);
29-
if (getOption("compileDirectives") === true) el.__stimulusX_directives = directives;
29+
if (getOption("compileDirectives") === true && attributes === el.attributes)
30+
el.__stimulusX_directives = directives;
3031
}
3132

3233
return directives

0 commit comments

Comments
 (0)