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

Add a check to prevent simultaneous use of rails-ujs and alt-ujs #3

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

taketo1113
Copy link
Owner

Summary

Raises an error if both rails-ujs and alt-ujs are loaded, ensuring only alt-ujs is used when both are present.

Details

If both alt-ujs and rails-ujs are loaded, events like the confirm event may be triggered multiple times.
To prevent this, an error is raised when rails-ujs is detected.

Whether rails-ujs is loaded is determined by checking window._rails_loaded.
https://github.com/rails/rails/blob/7-1-stable/actionview/app/javascript/rails-ujs/index.js#L135

@taketo1113 taketo1113 self-assigned this Nov 25, 2024
@taketo1113 taketo1113 merged commit 731f37c into master Nov 25, 2024
3 checks passed
@taketo1113 taketo1113 deleted the add-error-use-rails-ujs branch November 25, 2024 05:17
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.

1 participant