-
Notifications
You must be signed in to change notification settings - Fork 430
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
Pass arbitrary dataset values to data-turbo-confirm
via data-turbo-method
links?
#811
Comments
The element that has the data-confirm attribute should get passed along 👍 |
Just submitted #856 to fix this. In the meantime, you should use |
@excid3 I can confirm this fixes this bug, but it doesn't play nice with ex. button groups of bootstrap :-( |
Hi, I ended up needing to implement a similar workaround—curious if there are still plans to merge this? Thanks! |
Following @excid3's awesome work in #525 enabling custom confirmation dialogs via
data-turbo-confirm
, I've run into a scenario where it doesn't seem like it's currently possible to pass additional information to theTurbo.setConfirmMethod
function whendata-turbo-confirm
is placed ondata-turbo-method
links.Consider:
I have a delete link:
Clicking that link causes a hidden
form
element to get created in order to trigger the form submission, here: https://github.com/hotwired/turbo/blob/main/src/observers/form_link_click_observer.ts#L33-L60The problem is, only a subset of the dataset is passed along with the
form
element to theconfirmMethod
call.In order to work around this, I'm manually querying the DOM for the original link via something like this:
I'd love to be able to just pull those extra data attributes off of the
element
(theform
element) instead. Would you be open to accepting a PR that allows that to be possible?The text was updated successfully, but these errors were encountered: