Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 297443

Right click should not submit buttons with Ajax behaviors

$
0
0

Problem/Motivation

Currently, the Drupal ajax framework uses mousedown to capture the click even for triggering ajax. This causes some usability problems because it means all mouse interactions trigger the ajax event. This is also a accessibility problem because it
violates WCAG 2.1 https://www.w3.org/TR/WCAG21/#pointer-cancellation

Steps to reproduce

  1. Install Drupal 10
  2. Add a file field to articles. Set Allowed number of values to Unlimited
  3. Create an article. Add several files to it.
  4. Right click on the remove button and see the file be removed.

Proposed resolution

Replace mousdown with click event handlers.

Remaining tasks

Review and commit.

User interface changes

API changes

Data model changes

Release notes snippet

Original report by @mibfire

I have noticed that when #ajax is attached to a submit button the right click(and all other buttons of mouse, like middle) is working as well and i dont think it should. It is because the ajax.js uses the mousedown event in default. I would like to know if there is some reason for using mousedown because i think this should work only with (left)click. THX


Viewing all articles
Browse latest Browse all 297443

Trending Articles