Nothing happens if you try to press the "Add above" button using keyboard. If you have CSP module enabled, the form submits when you press "Add above" and a violation is reported unless unsafe-inline script-src is allowed. The reason for this is that the button uses onclick handler to disable click and mousedown event for clickHandler. Using click event for clickHandler fixes both problems.
The CSP problem was introduced with onClick attribute in #3133439: Disable Add Above when Add Mode is other than Modal.
Mousedown event was introduced in #2946514: Add paragraph before button. The reason why click event didn't work was explained in comment 43 point 4, but that was fixed in #3092762: Unable to access toggle button options using keyboard navigation..
Additionally, the clickHandler needed to stop propagation of mousedown event in #3213737: 'Add above' in edit paragraph library in modal is behind parent dialog, not sure if that is the case with click event.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | paragraphs-3359321-add_above_button.patch | 1.7 KB | olli |
Issue fork paragraphs-3359321
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
olli commentedComment #6
sokru commentedRebased and converted the patch to MR. Tested the fix manually to be working and since the test results are green, changing the status to RTBC.
Comment #8
berdirMerged.