Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

md-text-area placeholder issue #192

Closed
easyt opened this issue Jun 8, 2016 · 3 comments
Closed

md-text-area placeholder issue #192

easyt opened this issue Jun 8, 2016 · 3 comments
Labels

Comments

@easyt
Copy link

easyt commented Jun 8, 2016

Hey Daniel,

There is a small issue when using the md-text-area with md-placeholder. The code fails at the following location:

this.input.setAttribute('placeholder', this.mdPlaceholder);

this.input is undefined. The reason for this is the binding in the md-input template: if.bind="mdTextArea === true" since it requires a boolean value.

Initially, if we use the following:
<md-input md-label="Description" md-placeholder="Enter a description" md-text-area="true"></md-input>

The md-text-area="true" is evaluated to a true string and not a boolean.

If I use the following:
<md-input md-label="Description" md-placeholder="Enter a description" md-text-area.one-time="true"></md-input>

It works because the one-time binding is evaluating the true to a boolean value.

You might try moving the following line from the attached to the bind method of the md-input custom element:

this.mdTextArea = getBooleanFromAttributeValue(this.mdTextArea);

@Thanood
Copy link
Collaborator

Thanood commented Jun 8, 2016

Great bug report, thanks! 😄
It's interesting though, that it seems to work in the sample.

If you like, you can also issue a PR and I will merge it.
If you do, please follow our commit message conventions.

@Thanood Thanood added the bug label Jun 8, 2016
@Thanood Thanood closed this as completed in d63aff6 Jun 8, 2016
@Thanood
Copy link
Collaborator

Thanood commented Jun 8, 2016

Done and updated samples to show text area placeholders.
Thanks again for the suggestion and solution. 😄

@easyt
Copy link
Author

easyt commented Jun 8, 2016

Thanks for the fix!

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

No branches or pull requests

2 participants