Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By pillarsdotnet on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
7.x
Introduced in version:
7.6
Description:
A new #ajax['prevent']
property was added, defaulting to 'click'
.
Binding to 'mousedown'
rather than 'click'
means that it is possible to trigger a click by:
- Pressing the mouse button
- Holding the mouse button down until the Ajax request is complete and the button is re-enabled.
- Then releasing the mouse button.
Setting the 'prevent'
property makes ajax.js
bind an additional handler to prevent such a click from triggering a non-Ajax form submission. This also prevents a textfield's <Enter>
keypress from triggering this button's non-Ajax form submission behavior.
Impacts:
Module developers
Themers