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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pillarsdotnet’s picture

Here is a patch to the Forms API Reference for consideration.

This patch applies to the 8.x-1.x branch of the Documentation project.

jhodgdon’s picture

Issue tags: +FAPI reference

We 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.

pillarsdotnet’s picture

We have a standard tag for the FAPI reference.

I'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.

this needs to be put into the 8.x and 7.x versions

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.

jhodgdon’s picture

The 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. :(

pillarsdotnet’s picture

Status: Active » Needs review

I 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.

jn2’s picture

Status: Needs review » Fixed

The patch has been added to the FAPI reference, both D7 and D8 versions.

pillarsdotnet’s picture

pillarsdotnet’s picture

Status: Fixed » Needs review
FileSize
6.06 KB

Patch.

jn2’s picture

Status: Needs review » Fixed

New patch added to D7 and D8 versions of FAPI reference.

Automatically closed -- issue fixed for 2 weeks with no activity.