Skip to content

fix(web-components): TextArea auto-resize moves instead of grows in Firefox#35849

Open
Copilot wants to merge 6 commits intomasterfrom
copilot/fix-textarea-autoresize-firefox
Open

fix(web-components): TextArea auto-resize moves instead of grows in Firefox#35849
Copilot wants to merge 6 commits intomasterfrom
copilot/fix-textarea-autoresize-firefox

Conversation

Copy link
Contributor

Copilot AI commented Mar 9, 2026

  • Fix the maybeCreateAutoSizerEl method to place the auto-sizer div inside .root (the CSS grid container) instead of at the shadow root level
  • Add rootEl ref to the template's .root div
  • Add public rootEl!: HTMLDivElement to BaseTextArea class
  • Change this.shadowRoot!.prepend(this.autoSizerEl) to this.rootEl?.prepend(this.autoSizerEl) with explanatory comment
  • Add test verifying auto-sizer is placed inside .root when field-sizing: content is not supported (mocking CSS.supports)
  • Fix TypeScript type error: node.autoSizerEl is HTMLDivElement | undefined but contains() expects Node | null — use node.autoSizerEl ?? null
  • Update docs/api-report.md to include the new rootEl property
  • Regenerate docs/web-components.api.md via nx run web-components:build (API Extractor runs as part of build)
  • Add beachball change file for @fluentui/web-components with type prerelease
  • nx run web-components:type-check passes
  • All 53 textarea tests pass
Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: TextArea AutoResize not working on FireFox</issue_title>
<issue_description>### Component

TextArea

Package version

3.0.0-rc.8

@microsoft/fast-element version

2.10.0

Environment

Stackblitz

Current Behavior

When pressing enter in an AutoResize TextArea, the area itself is moved one line down on the page

Expected Behavior

The area should grom one line per enter (as it is doing on Chromium based browsers)

Reproduction

https://stackblitz.com/edit/typescript-agqc2iuc

Steps to reproduce

  • Go to the repo code on Stackblitz in FireFox
  • Press enter in the shown TextArea and see it move on the page

Are you reporting an Accessibility issue?

no

Suggested severity

Urgent - No workaround and Products/sites are affected

Products/sites affected

Fluent UI Blazor library

Are you willing to submit a PR to fix?

no

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…inside root element

Co-authored-by: Hotell <1223799+Hotell@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix TextArea AutoResize issue on Firefox fix(web-components): TextArea auto-resize moves instead of grows in Firefox Mar 9, 2026
@Hotell
Copy link
Contributor

Hotell commented Mar 9, 2026

@copilot type check is failing, make sure nx run web-components:type-check passes

… null coalescing for autoSizerEl

Co-authored-by: Hotell <1223799+Hotell@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 9, 2026

@copilot type check is failing, make sure nx run web-components:type-check passes

Fixed in 934fc85. The issue was node.autoSizerEl is typed as HTMLDivElement | undefined, but contains() expects Node | null. Changed root?.contains(node.autoSizerEl) to root?.contains(node.autoSizerEl ?? null) to handle the undefined case. nx run web-components:type-check now passes.

@Hotell
Copy link
Contributor

Hotell commented Mar 9, 2026

@copilot you need to commit that re-generated /packages/web-components/docs/web-components.api.md

…El property

Co-authored-by: Hotell <1223799+Hotell@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 9, 2026

@copilot you need to commit that re-generated /packages/web-components/docs/web-components.api.md

Done in 9f62c29. Ran nx run web-components:build which triggers API Extractor as part of the build pipeline — docs/web-components.api.md now includes the rootEl property.

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

Pull request demo site: URL

@Hotell
Copy link
Contributor

Hotell commented Mar 9, 2026

@copilot generate change files yarn change with type patch

Co-authored-by: Hotell <1223799+Hotell@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 9, 2026

@copilot generate change files yarn change with type patch

Done in c843838. Added a beachball change file for @fluentui/web-components with type patch.

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

📊 Bundle size report

✅ No changes found

@@ -0,0 +1,7 @@
{
Copy link

Choose a reason for hiding this comment

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

🕵🏾‍♀️ visual changes to review in the Visual Change Report

vr-tests-web-components/Badge 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-web-components/Badge. - Dark Mode.normal.chromium.png 443 Changed
vr-tests-web-components/MenuList 3 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-web-components/MenuList. - Dark Mode.normal.chromium.png 498 Changed
vr-tests-web-components/MenuList. - RTL.2nd selected.chromium.png 17 Changed
vr-tests-web-components/MenuList. - RTL.1st selected.chromium_2.png 39384 Changed

@Hotell Hotell marked this pull request as ready for review March 9, 2026 15:00
@Hotell Hotell requested a review from a team as a code owner March 9, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: TextArea AutoResize not working on FireFox

3 participants