Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

Password TextFieldView is rendered as regular text after FormView.clearForm() #91

Open
aliozgur opened this issue Dec 24, 2012 · 3 comments
Assignees

Comments

@aliozgur
Copy link

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.

@aliozgur
Copy link
Author

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.

@dominiklaubach
Copy link
Contributor

thx for the hint. we will look into it.

@ghost ghost assigned dominiklaubach Dec 27, 2012
@aliozgur
Copy link
Author

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();
      }
  },

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants