Commit d9d0db43 authored by Oliver Hader's avatar Oliver Hader Committed by Andreas Fernandez
Browse files

[BUGFIX] Avoid showing password on MacBook touch bar in backend forms

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/+/60678

Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
parent a224d955
......@@ -635,9 +635,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');
});
};
......
......@@ -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) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment