Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutation observer wouldn't fire in certain situations #479

Merged
merged 3 commits into from
Mar 25, 2021

Conversation

joshleblanc
Copy link
Contributor

@joshleblanc joshleblanc commented Mar 25, 2021

In certain situations where you're morphing an element that does not contain a data-reflex attribute, the mutation observer wouldn't fire.

Type of PR (feature, enhancement, bug fix, etc.)

bug fix

Description

The attributeFilter option of mutation observer checks that any changed element has any attribute in the list of filters. If you morph an element without a data-reflexattribute, this mutation observer won't fire.

W4KRcTF9nt

@leastbad's note: adding actionAttribute to the list of observed attributes is a viable solution because setupDeclarativeReflexes adds __perform, a private/internal action. This makes it a reliable litmus test for the edge case this PR addresses.

Checklist

  • My code follows the style guidelines of this project
  • Checks (StandardRB & Prettier-Standard) are passing
  • This is not a documentation update

In certain situations where you're morphing an element that does not contain a data-reflex attribute, the mutation observer wouldn't fire.
@joshleblanc joshleblanc changed the title mutation observer wouldn't fire Mutation observer wouldn't fire in certain situations Mar 25, 2021
@leastbad leastbad merged commit 52f688d into stimulusreflex:master Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants