-
Notifications
You must be signed in to change notification settings - Fork 437
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
Change [data-turbo] guard to [data-turbo-drive] #2
Conversation
According to the website's documentation, consumers can disable Turbo integration for their links by declaring [data-turbo-drive="false"][turbo-drive]. This commit modifies the guard clause to check the attribute that the documentation mentions. [turbo-drive]: https://turbo.hotwire.dev/handbook/drive#disabling-turbo-drive-on-specific-links
linkIsVisitable(link: Element) { | ||
const container = closest(link, "[data-turbo]") | ||
turboDriveIsEnabled(link: Element) { | ||
const container = closest(link, "[data-turbo-drive]") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#3 adds support for skipping form submissions in the same way that we skip <a>
navigations.
Should we check for two attributes: [data-turbo="false]
and [data-turbo-drive="false"]
? If #3 guards submissions in the same way, does replacing [data-turbo-drive="false"]
checks with [data-turbo="false"]
make sense?
Re-stated, is the implementation incorrect, or is the documentation incorrect?
Actually the docs were written before we decided to go with |
@sstephenson does that apply for attributes like |
Yup, just |
Replace all references to `TurboDrive.` with `Turbo.` Replace `data-turbo-drive-*` prefixed attributes with `data-turbo-*`. [hotwired/turbo#2]: hotwired/turbo#2 [comment]: hotwired/turbo#2 (comment)
Closing in favor of hotwired/turbo-site#2. |
According to the website's documentation, consumers can disable Turbo
integration for their links by declaring
data-turbo-drive="false".
This commit modifies the guard clause to check the attribute that the
documentation mentions.