See #634616-77: Various problems due to AJAX binding to mousedown instead of click
The change that this patch makes is adding a new property to AJAX settings, called 'prevent' and any event that is set in this property will be bound to 'false' when the JS for ajax run on a given form. This property defaults to 'click' meaning that while the ajax event is bound to mousedown to start with, if a click event should happen, even by accident, it will be found to false, and not trigger an inadvertent form submission.
Comment | File | Size | Author |
---|---|---|---|
#8 | form_api-ajax-1206866-8.patch | 6.06 KB | pillarsdotnet |
#1 | form_api-ajax_prevent-1206866-1.patch | 1.59 KB | pillarsdotnet |
Comments
Comment #1
pillarsdotnet CreditAttribution: pillarsdotnet commentedHere is a patch to the Forms API Reference for consideration.
This patch applies to the 8.x-1.x branch of the Documentation project.
Comment #2
jhodgdonWe have a standard tag for the FAPI reference.
I'm pretty sure, judging by the issue this came from, that this needs to be put into the 8.x and 7.x versions of the FAPI reference if possible.
Comment #3
pillarsdotnet CreditAttribution: pillarsdotnet commentedI'm sure you get tired of telling clueless people like me about these standards. It might save time create a documentation page somewhere listing the standard tags used for core issues. I know that I, for one, would really appreciate such a reference.
Again, I am displaying my ignorance. I had thought, based on feedback from senior developers, that the "Needs backport to D7" tag implies the need for such a backport. Obviously, I am once again mistaken, and in need of further instruction.
Comment #4
jhodgdonThe person who maintains the FAPI reference might not be aware of the backport tag's significance, which is why I added that note for her. Just in case. :)
And yes the FAPI reference tag should be documented somewhere, but in this case it's just for her and just for this project, so I don't mind just adding it. Sorry if all that annoyed you. :(
Comment #5
pillarsdotnet CreditAttribution: pillarsdotnet commentedI suppose if I had read your comment as a private message to jn1 rather than a response to my initial posting, I would have taken it differently. I will try to be more sensitive to such a possibility in the future.
Comment #6
jn2 CreditAttribution: jn2 commentedThe patch has been added to the FAPI reference, both D7 and D8 versions.
Comment #7
pillarsdotnet CreditAttribution: pillarsdotnet commentedUpdated according to #634616-99: Various problems due to AJAX binding to mousedown instead of click
Also added links to the Ajax framework api page.
Comment #8
pillarsdotnet CreditAttribution: pillarsdotnet commentedPatch.
Comment #9
jn2 CreditAttribution: jn2 commentedNew patch added to D7 and D8 versions of FAPI reference.