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

feat(textarea): add md-autosize directive #1846

Merged
merged 1 commit into from
Nov 16, 2016
Merged

Conversation

jelbourn
Copy link
Member

R: @mmalerba

CC: @fxck

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 13, 2016
@fxck
Copy link
Contributor

fxck commented Nov 13, 2016

Yeah, LGTM. How about throwing an error when you try to use both autosize and rows?

@Input() minRows: number;

/** Maximum number of rows for this textarea. */
@Input() maxRows: number;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you also do an @input() for value so you can resize when the content is changed programmatically?

textareaClone.style.visibility = 'hidden';
textareaClone.style.padding = '';
textareaClone.style.minHeight = '';
textareaClone.style.height = '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also clear maxHeight and border

@@ -19,10 +19,24 @@ export class MdTextareaAutosize implements OnInit {
/** Maximum number of rows for this textarea. */
@Input() maxRows: number;

/** The value of the textarea. */
private _value: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this our team's official style for these getter/setters? If it's still up for debate, I prefer:

/** ... */
@Input()
get value() {...}
set value(v) {...}
private _value;

It's a good reminder that I should be accessing it through the getter unless I have a good reason not to.

@mmalerba
Copy link
Contributor

whoops, didn't notice this was still wip

@jelbourn
Copy link
Member Author

@mmalerba as we discussed, adding support for changing on value change is problematic, going to leave it out for now.

@fxck md-autosize will simply override rows now, which I think is a sensible behavior.

@mmalerba mmalerba self-assigned this Nov 16, 2016
@mmalerba
Copy link
Contributor

lgtm

@jelbourn jelbourn added the action: merge The PR is ready for merge by the caretaker label Nov 16, 2016
@kara kara merged commit 9ec17c0 into angular:master Nov 16, 2016
@jelbourn jelbourn deleted the autosize branch September 13, 2017 04:37
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants