Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(cdk/text-field): avoid page jump on auto-resize #32605

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

Open
CorentinDeBoisset wants to merge 1 commit into angular:main
base: main
Choose a base branch
Loading
from CorentinDeBoisset:main

Conversation

@CorentinDeBoisset
Copy link

@CorentinDeBoisset CorentinDeBoisset commented Dec 29, 2025

When we measure the size of the autosize textarea, we make it temporarily smaller which can cause the scroll position to shift. These changes add a workaround that assign a temporary margin-bottom while measuring.

Fixes #23834

Copy link
Contributor

mmalerba commented Jan 5, 2026

reassigning to @crisbeto since he was the author of the firefox-specific fix

const element = this._textareaElement;
const previousMargin = element.style.marginBottom || '';
const isFirefox = this._platform.FIREFOX;
const needsMarginFiller = isFirefox && this._hasFocus;
Copy link
Member

@crisbeto crisbeto Jan 6, 2026

Choose a reason for hiding this comment

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

I think we still need the _hasFocus part of this check. Otherwise we'll end up applying the margin on elements the user isn't interacting with.

CorentinDeBoisset reacted with thumbs up emoji
When we measure the size of the autosize textarea, we make it temporarily smaller which can cause the scroll position to shift. These changes add a workaround that assign a temporary margin-bottom while measuring.
Fixes angular#23834 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@crisbeto crisbeto crisbeto left review comments

@ok7sai ok7sai Awaiting requested review from ok7sai

@wagnermaciel wagnermaciel Awaiting requested review from wagnermaciel

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

bug(cdkTextareaAutosize): autosize scrolls parent to top at each key hit with ngZoneEventCoalescing enabled

AltStyle によって変換されたページ (->オリジナル) /