Skip to content

Commit

Permalink
[BUGFIX] Avoid showing password on MacBook touch bar in backend forms
Browse files Browse the repository at this point in the history
The auto suggest feature of MacBook's touch bar shows information of
just entered passwords when editing a record containing a password
field in backend forms. The behavior only occurs when Safari is used
as client and touch bar word completion is activated.

Resolves: #88286
Releases: master, 9.5, 8.7
Change-Id: I588a6edcfc34c403dc9f042adbeca2c711512228
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60690
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Richard Haeser <richard@maxserv.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Richard Haeser <richard@maxserv.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: TYPO3com <noreply@typo3.com>
  • Loading branch information
ohader authored and andreaskienast committed May 7, 2019
1 parent e855f9c commit ca6c68e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -764,9 +764,9 @@ define(['jquery',
});
$maxlengthElements.addClass('t3js-charcounter-initialized');
$(':password').on('focus', function() {
$(this).attr('type', 'text').select();
$(this).attr({'type':'text', 'data-active-password':'true'}).select();
}).on('blur', function() {
$(this).attr('type', 'password');
$(this).attr('type', 'password').removeAttr('data-active-password');
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,14 @@ var TBE_EDITOR = {
// EXT:backend/Resources/Public/JavaScript/FormEngine.js (reference: http://forge.typo3.org/issues/58755).
// TODO: This should be solved in a better way when this script is refactored.
window.setTimeout(function() {
document.getElementsByName(TBE_EDITOR.formname).item(0).submit();
var formElement = document.getElementsByName(TBE_EDITOR.formname).item(0);
$('[data-active-password]:not([type=password])').each(
function(index, element) {
element.setAttribute('type', 'password');
element.blur();
}
);
formElement.submit();
}, 100);
},
split: function(theStr1, delim, index) {
Expand Down

0 comments on commit ca6c68e

Please sign in to comment.