Problem/Motivation
The JS lock option adds a 'disabled' prop to a number of form input elements:
$form.find('input, textarea, select').prop('disabled', true).addClass('is-disabled');
However, this does not include all input elements, for example <button> see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled
Steps to reproduce
Add a <button> element to a form. Lock the form using JS lock
Proposed resolution
Disable all input elements with JS lock
Remaining tasks
- Write a patch
- Review
- Commit
User interface changes
JS lock disables all input elements.
API changes
None.
Data model changes
None.
Comments
Comment #2
idebr commentedAttached patch disables all input elements with JS lock using the jQuery
:inputselector: https://api.jquery.com/input-selector/Comment #3
idebr commentedComment #4
anneke_vde commentedTested the patch, the button is now also disabled.
Comment #5
akalam commentedSome themes like Gin have the buttons outside the form and therefore the buttons are not being disabled. Here is a patch with a solution working on all themes.
Comment #6
smustgrave commentedNeither #2 or #5 seem to disable ckeditor5 fields
Comment #8
smustgrave commentedActually it does fix the ckeditor and seems to be a wider net then #3396683: CKEditor5 field not getting disabled on locked form.
Comment #9
alexpottDoes this disable the ability to break the lock?
Comment #10
alexpottIt would be great to add a test here - specifically around disabling of CKEditor claims.
Comment #11
smustgrave commentedSo I just did a fresh install with 8.x-2.x and all the changes merged.
And ckeditor5 is now being disabled.
I think this MR is a better selector but could someone confirm?
Comment #12
smustgrave commentedTested on 2 other sites and ckeditor5 fields are now disabled after the recent merges to 8.x-2.x
Think this ticket still provides better selectors though.
Comment #13
alexpottCan we have an automated test of this - plus confirmation that this does not disable the unlock button has well.
Comment #14
smustgrave commentedWill work on trying to add a ckeditor5 field to be tested
Comment #15
smustgrave commentedTurned the existing body field into a field with a ckeditor5 formatter.
The unblock button doesn't appear when locked. But the "Break lock" link is fine.
Comment #16
smustgrave commentedClosed #3396683: CKEditor5 field not getting disabled on locked form as a duplicate.
Comment #17
smustgrave commentedRebased
Comment #18
smustgrave commentedHiding patches.
Comment #19
smustgrave commentedThe break lock link doesn't appear to be disabled.
Comment #20
alexpottThis looks good to go.
Comment #22
alexpott