The-M-Project
The-M-Project copied to clipboard
Password TextFieldView is rendered as regular text after FormView.clearForm()
TextFieldView with M.INPUT_PASSWORD type is rendered as regular text field after FormView.clearForm() is called if initialText is not set on the TextFieldView.
I have version 1.3 and the problem seems to be in setValue function of text_field.js. When I specify ' ' as the initialText the problem is resolved.
thx for the hint. we will look into it.
This seems to be a copy paste bug. Please see my comment below (text_field.js)
setValue: function(value, delegateUpdate, preventValueComputing) {
this.value = value;
// Handle the classOnInit for initial text
if(value != this.initialText) {
if(this.cssClassOnInit) {
this.removeCssClass(this.cssClassOnInit);
}
if(this.inputType == M.INPUT_PASSWORD) {
// Set the field type to password
$('#' + this.id).prop('type','password');
}
}
else {
if(this.cssClassOnInit) {
this.addCssClass(this.cssClassOnInit);
}
if(this.inputType == M.INPUT_PASSWORD) {
// Set the field type to text
// Ali özgür : COPY/PASTE BUG :)
// $('#' + this.id).prop('type','text');
$('#' + this.id).prop('type','password');
}
}
this.renderUpdate(preventValueComputing);
if(delegateUpdate) {
this.delegateValueUpdate();
}
},