This is a follow-up issue from Claro: #3024395: Password Field Style Update
c/ @huzooka @fhaeberle See comment #25
Problem/Motivation
Is not possible to use classes to style separatly the input and it's helper text "Passwords match: (yes/no)" using classes. This is caused because both elements are using password-confirm class.
Proposed resolution
Rework the JS elements of the password field to:
- Create a new JavaScript theme function so that BC layer can be added in Stable
- Replace password-confirm class with password-confirm-message for the text "Passwords match:"
API changes
password-confirm class has been replaced with password-confirm-message for the text "Passwords match:" text. There's a backwards compatibility layer to add password-confirm back in Stable.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | interdiff.txt | 938 bytes | lauriii |
| #17 | 3061265-17.patch | 5.74 KB | lauriii |
| #12 | interdiff.txt | 3.58 KB | lauriii |
| #12 | 3061265-12.patch | 6.36 KB | lauriii |
| #7 | interdiff.txt | 2.21 KB | lauriii |
Comments
Comment #2
quironIn this patch:
- Moved helper messages templating from
user.jstouser.theme.jsto use Drupal.theme functions and updated it inuser.js- Changed the class
password-confirmtopassword-confirm-messagein the helper text "Passwords match: (yes/no)" to prevent styling with classes conflicts (See: #3024395: Password Field Style Update- Updated
classy/css/components/user.cssto use the newpassword-confirm-messageclass.Comment #3
niyas commentedThis patch seems to work fine.. Suggesting RTBC..
Comment #4
lauriiiThis seems like a small BC break. This change makes 100% sense but let's override this theme function in Stable with the pre-existing markup to not risk break existing themes.
Comment #5
rosinegrean commentedComment #6
lauriiiComment #7
lauriiiImplemented BC layer for the markup changes. I also removed changes made to Classy because Classy extends Stable.
Comment #8
lauriiiI created a change record. I also checked whether this would break Bootstrap theme and I could confirm that they don't have any selectors using
password-confirmclass.Comment #9
huzookaRe #7, only superficially:
Please do not add this CSS class in JavaScript! Neither the
.password-parentone a few lines up.I'd change this qualifying selector to something that is prefixed with 'js-'
Comment #10
lauriii@huzooka I don't think those changes are in the scope of what is currently described in the issue summary. I think those are both potentially valid issues. Could you open another issue for trying to tackle them?
Comment #11
lauriiiComment #12
lauriiiI removed the password meter theme function from the patch since it is unrelated to this issue. We should solve that in a separate issue.
Comment #13
bnjmnmThe patch looks good - there's just a few clerical things to attend to before I can set to RTBC:
I'm assuming this was added to emphasize there's no breaking changes, but it may be helpful to mention that a new class is still made available to themes that extend Stable or Classy so this isn't interpreted as Stable/Classy not being impacted at all.
Comment #14
lauriii#13.1: Follow-up can be found here #3067523: Add Drupal JavaScript theme functions for password confirm widget.
#13.2-4: Fixed 👍
Comment #15
bnjmnmPaperwork is in good standing, so RTBC.
Comment #16
catchThis line is being removed from user.js but not user.es6.js. Unintentional change?
Comment #17
lauriiiIt seems like there's been some issue with the compilation of the JavaScript. Here's a new patch with recompiled JavaScript.
Comment #18
larowlanComment #20
larowlanCommitted 52a0740 and pushed to 8.8.x. Thanks!
Published change record.
BC layer for stable ✅
Nice work all.