From 9733ccc381e8b2ee4852f1aaba119c8d384ec8f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Mart=C3=ADn?= Date: Wed, 13 Mar 2024 08:01:57 +0100 Subject: [PATCH] MDL-81188 form: Fix password element layout MDL-75670 generated a regression in forms password element layout that was not being displayed in a single line as before. - Modify the password element template to display the input and the password unmask icon in a single line. - Change the password unmask button styles to be consistent with other focus states. - Modify passwordunmask behat form field to work with the new password element layout changes. --- .../form_field/behat_form_passwordunmask.php | 2 +- .../templates/element-passwordunmask.mustache | 62 ++++++++++--------- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/lib/behat/form_field/behat_form_passwordunmask.php b/lib/behat/form_field/behat_form_passwordunmask.php index 91840fdfdce..26b7643ed87 100644 --- a/lib/behat/form_field/behat_form_passwordunmask.php +++ b/lib/behat/form_field/behat_form_passwordunmask.php @@ -55,7 +55,7 @@ class behat_form_passwordunmask extends behat_form_text { } $id = $this->field->getAttribute('id'); - $wrapper = $this->field->getParent()->getParent()->find('css', '[data-passwordunmask="wrapper"]'); + $wrapper = $this->field->getParent()->getParent()->getParent()->find('css', '[data-passwordunmask="wrapper"]'); $wrapper->click(); $this->wait_for_pending_js(); diff --git a/lib/form/templates/element-passwordunmask.mustache b/lib/form/templates/element-passwordunmask.mustache index 1491fbd07cc..40666ba55a3 100644 --- a/lib/form/templates/element-passwordunmask.mustache +++ b/lib/form/templates/element-passwordunmask.mustache @@ -47,41 +47,43 @@ }} {{< core_form/element-template }} {{$ element }} - - - - - {{^ element.frozen }} - - {{/ element.frozen }} - {{> core_form/element-passwordunmask-fill }} - {{^ element.frozen }} - {{# pix }} t/passwordunmask-edit, core, {{# str }} passwordunmaskedithint, form {{/ str }}{{/ pix }} - - {{/ element.frozen }} - - {{# pix }} t/passwordunmask-reveal, core, {{# str }} passwordunmaskrevealhint, form {{/ str }}{{/ pix }} - +
+ - +
{{/ element }} {{/ core_form/element-template }} {{#js}}