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

fix(cdk/text-field): Long multiline textfield focus issue #30312

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/cdk/text-field/autosize.ts
Original file line number Diff line number Diff line change
@@ -367,6 +367,8 @@ export class CdkTextareaAutosize implements AfterViewInit, DoCheck, OnDestroy {
// it to receive focus on IE and Edge.
if (!this._destroyed.isStopped && this._hasFocus) {
textarea.setSelectionRange(selectionStart, selectionEnd);
textarea.blur();
Copy link
Contributor

@mmalerba mmalerba Feb 20, 2025

Choose a reason for hiding this comment

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

I'm worried this could have some kind of accessibility consequences. I see that the original issue was filed as affecting ie11 which isn't a browser we support at this point. Unless this is known to affect other browsers that we do still support I don't think we necessarily need to make any change here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had tested it on Chrome and it was not working as expected, I mean it was causing the same issue as mentioned. But it causes issue only when its very long text. So, if we do not want to fix the issue, better to close ? :)

textarea.focus();
}
}
}