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

allow adding of data attributes (for Turbo/Stimulus Reflex) #96

Open
scottbarrow opened this issue Mar 9, 2021 · 0 comments
Open

allow adding of data attributes (for Turbo/Stimulus Reflex) #96

scottbarrow opened this issue Mar 9, 2021 · 0 comments

Comments

@scottbarrow
Copy link

When notfy is used with modern Multi page applications e.g. Rails, using Stimulus, Stimulus Reflex or Turbo - it is often required to have elements persist throughout page refreshes or DOM diff replacements.
Currently NotyfView adds the .notyf container dynamically when first instantiated, and only once, however this does not survive page reloads even through a memoized instance of Notyf would.
Therefore it's beneficial that the notyf element is able to survive DOM replacements by turbo or otherwise, this is accomplished with data-reflex-permanent, or data-turbo-permanent respectively. While these attributes can be added dynamically Notyf adds/removes this element seemingly at will

Would you be open to a PR that allows data attributes to be passed to the .notyf and .notyf-announcer container elements?

@scottbarrow scottbarrow changed the title allow adding of data attributes allow adding of data attributes (for Turbo/Stimulus Reflex) Mar 9, 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

No branches or pull requests

1 participant