Skip to content

fix(text-field): autosize textarea not resizing on minRows decrease - #13437

Merged
josephperrott merged 1 commit into
angular:masterfrom
jelbourn:autosize-minmax-live
Oct 19, 2018
Merged

fix(text-field): autosize textarea not resizing on minRows decrease#13437
josephperrott merged 1 commit into
angular:masterfrom
jelbourn:autosize-minmax-live

Conversation

@jelbourn

Copy link
Copy Markdown
Contributor

Fixes#13163

@jelbournjelbourn added the target: patch This PR is targeted for the next patch release label Oct 5, 2018
@jelbourn
jelbourn requested a review from mmalerbaOctober 5, 2018 00:38
@googlebotgooglebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 5, 2018

@crisbetocrisbeto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Comment threadsrc/cdk/text-field/autosize.ts Outdated
get minRows(): number { return this._minRows; }
set minRows(value: number) {
if (value !== this._minRows) {
this._minRowsChanged = true;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should be able to reduce this to this._minRowsChanged = value !== this._minRows. It's unlikely for this to be called quickly enough as to have the _minRowsChanged be overwritten before we've had a chance to resize.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think even better is to keep track of the number at the last resize rather than a boolean. That way if they change it to something new and then back to the original we can skip the work (I don't know if this will ever come up in real situations, but technically more correct)

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Done

@crisbetocrisbeto added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Oct 5, 2018
@jelbourn
jelbournforce-pushed the autosize-minmax-live branch from 6341079 to be82d57CompareOctober 5, 2018 18:02
@ngbot

This comment has been minimized.

1 similar comment
@ngbot

ngbotBot commented Oct 11, 2018

Copy link
Copy Markdown

Hi @jelbourn! This PR has merge conflicts due to recent upstream merges.
Please help to unblock it by resolving these conflicts. Thanks!

@jelbourn
jelbournforce-pushed the autosize-minmax-live branch from be82d57 to d9c4d14CompareOctober 11, 2018 17:10
@ngbot

This comment has been minimized.

@angular-automatic-lock-bot

Copy link
Copy Markdown

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-botangular-automatic-lock-botBot locked and limited conversation to collaborators Sep 9, 2019
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: mergeThe PR is ready for merge by the caretakercla: yesPR author has agreed to Google's Contributor License Agreementtarget: patchThis PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changes min rows on a textarea inside a MatFormField is not reflected in a runtime.

5 participants

@jelbourn@crisbeto@mmalerba@googlebot@josephperrott