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

data-disable-with #37

Closed
jakehockey10 opened this issue Dec 25, 2020 · 4 comments
Closed

data-disable-with #37

jakehockey10 opened this issue Dec 25, 2020 · 4 comments

Comments

@jakehockey10
Copy link

Hello,

I thought I had read something about data-disable-with related to turbo-rails, but I can't find it in my history anywhere. I notice that data: { disable_with: '...' } doesn't seem to work anymore when making the transition to turbo-rails from turbolinks and rails-ujs.

I wasn't quite sure what made data-disable-with work in the past, but I'm assuming it was rails-ujs since it doesn't seem to be related to turbolinks and the only other thing I removed to make way for turbo-rails was rails-ujs.

Are we planning on having data-disable-with functionality restored? Or is this something we should implement ourselves from here on out?

I've really enjoyed learning about the new magic, thanks for all the efforts!

@jakehockey10
Copy link
Author

I found where I had read something that mentioned data-disable-with and turbo in the same conversation. I wasn't able to find anything beyond these mentionings:

https://discourse.stimulusjs.org/t/stimulus-and-rails-ujs/587/10
https://discuss.hotwire.dev/t/are-transitions-and-animations-on-hotwire-roadmap/1547/3

@dhh
Copy link
Member

dhh commented Dec 30, 2020

Documented the compatibility with turbo-rails and UJS. And we've also stopped taking UJS out when using the Webpack installer.

@dhh dhh closed this as completed Dec 30, 2020
@jakehockey10
Copy link
Author

The link above didn't work for me, but here is where I found the documentation you mention: https://github.com/hotwired/turbo-rails#compatibility-with-rails-ujs

@coorasse
Copy link

coorasse commented Jan 5, 2021

Also, seems duplicate of hotwired/turbo#55. I solved with @seanpdoyle polyfill.

seanpdoyle added a commit to seanpdoyle/turbo-rails that referenced this issue Jan 25, 2021
Closes hotwired#33.
Closes hotwired#37.

---

Re-create [hotwired/turbo#40][].

When loaded alongside [@rails/ujs][], start it via `Rails.start()`, and
then declare the [`turbo:`-prefixed events][turbo-events] that
correspond to their `ajax:`-prefixed counterparts.

Test suite changes
---

First, introduce System Test coverage to drive the Turbo and Rails
integration through a headless browser.

Next, change some dummy controller actions to accept a `?sleep=` query
parameter to delay their responses long enough to ensure that
`data-disabled-with` and `data-confirm` have a wide enough window of
opportunity for test coverage to exercise their behaviors.

[hotwired/turbo#40]: hotwired/turbo#40
[@rails/ujs]: https://github.com/rails/rails/tree/v6.1.0/actionview/app/assets/javascripts
[turbo-events]: https://turbo.hotwire.dev/reference/events
seanpdoyle added a commit to seanpdoyle/turbo-rails that referenced this issue Jan 25, 2021
Closes hotwired#33.
Closes hotwired#37.

---

Re-create [hotwired/turbo#40][].

When loaded alongside [@rails/ujs][], start it via `Rails.start()`, and
then declare the [`turbo:`-prefixed events][turbo-events] that
correspond to their `ajax:`-prefixed counterparts.

Test suite changes
---

First, introduce System Test coverage to drive the Turbo and Rails
integration through a headless browser.

Next, change some dummy controller actions to accept a `?sleep=` query
parameter to delay their responses long enough to ensure that
`data-disabled-with` and `data-confirm` have a wide enough window of
opportunity for test coverage to exercise their behaviors.

[hotwired/turbo#40]: hotwired/turbo#40
[@rails/ujs]: https://github.com/rails/rails/tree/v6.1.0/actionview/app/assets/javascripts
[turbo-events]: https://turbo.hotwire.dev/reference/events
seanpdoyle added a commit to seanpdoyle/turbo-rails that referenced this issue Jan 25, 2021
Closes hotwired#33.
Closes hotwired#37.

---

Re-create [hotwired/turbo#40][].

When loaded alongside [@rails/ujs][], start it via `Rails.start()`, and
then declare the [`turbo:`-prefixed events][turbo-events] that
correspond to their `ajax:`-prefixed counterparts.

Test suite changes
---

First, introduce System Test coverage to drive the Turbo and Rails
integration through a headless browser.

Next, change some dummy controller actions to accept a `?sleep=` query
parameter to delay their responses long enough to ensure that
`data-disabled-with` and `data-confirm` have a wide enough window of
opportunity for test coverage to exercise their behaviors.

[hotwired/turbo#40]: hotwired/turbo#40
[@rails/ujs]: https://github.com/rails/rails/tree/v6.1.0/actionview/app/assets/javascripts
[turbo-events]: https://turbo.hotwire.dev/reference/events
seanpdoyle added a commit to seanpdoyle/turbo-rails that referenced this issue Jan 25, 2021
Closes hotwired#33.
Closes hotwired#37.

---

Re-create [hotwired/turbo#40][].

When loaded alongside [@rails/ujs][], start it via `Rails.start()`, and
then declare the [`turbo:`-prefixed events][turbo-events] that
correspond to their `ajax:`-prefixed counterparts.

Test suite changes
---

First, introduce System Test coverage to drive the Turbo and Rails
integration through a headless browser.

Next, change some dummy controller actions to accept a `?sleep=` query
parameter to delay their responses long enough to ensure that
`data-disabled-with` and `data-confirm` have a wide enough window of
opportunity for test coverage to exercise their behaviors.

[hotwired/turbo#40]: hotwired/turbo#40
[@rails/ujs]: https://github.com/rails/rails/tree/v6.1.0/actionview/app/assets/javascripts
[turbo-events]: https://turbo.hotwire.dev/reference/events
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants