Restore long-lost form-handling ability to modal.js interactivity in modal dialog#3772
Restore long-lost form-handling ability to modal.js interactivity in modal dialog#3772
Conversation
e269521 to
9b94a0a
Compare
|
@jrochkind, does this fix #2331? |
|
i didn't notice that issue @ebenenglish , but it does! i meant to fill out total description here before I submitted, will convert to draft until it's totally done. |
|
Do we need this in Blacklight? Blacklight doesn't have forms in the modal, right? Can this go in your own app? We have forms in our modal, but we wouldn't want the behavior you have defined here. Our form submission closes the modal and shows feedback in a "toast". |
|
@jcoyne As I wrote in description already:
and:
One possible additional question:
The behavior here is opt-in with a data attribute on your form (just as it already was for links, not every link in a modal) if this behavior were merged, it would not affect your forms in modals. |
Originally modal.js could handle form submissions in a modal as well as links.
But this behavior wasn't actually used by Blacklight, or tested -- it was available for Blacklight apps to use though. It made sense to support since it was a variation on the hyperlink behavior, keep it DRY.
But it was removed in some prior commits refactoring, perhaps be61504, if not before -- it was quite possibly already broken at that point.
This PR adds it back in, in case it is desired by community!
i got to needing this for a local app, but if it is not desired to be part of BL, it's okay with me, I can easily patch it back in locally only in my app.
It does not at present have tests. it's kind of a pain to have tests, since there is no behavior in default BL that exersizes it, we'd have to figure out how to add exersizing behavior to test app somehow, which engine_cart makes difficult. If there is interest in this feature, and people believe tests are necessary, perhaps we can join heads on how to do it.
Closes #2331