Fix multiline TextInput excessive spacing from trailing whitespace calculation#15501
Draft
Fix multiline TextInput excessive spacing from trailing whitespace calculation#15501
Conversation
…ENTWSP to TXTNS_FITTOCONTENT Co-authored-by: HariniMalothu17 <185761277+HariniMalothu17@users.noreply.github.com>
Co-authored-by: HariniMalothu17 <185761277+HariniMalothu17@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix multiline TextInput space usage issue
Fix multiline TextInput excessive spacing from trailing whitespace calculation
Dec 23, 2025
|
Excited to have a fix for this! :) |
Contributor
|
I doubt this is the right fix. Without TXTNS_FITTOCONTENTWSP, the textinput will not expand when the user creates a new line in a multiline textinput? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Type of Change
Why
Multiline TextInput components were displaying excessive blank vertical space below text content and wrapping prematurely. The root cause was
GetContentSize()usingTXTNS_FITTOCONTENTWSPwhen querying RichEdit's natural size, which includes trailing whitespace in measurements—causing RichEdit to allocate space for non-existent characters.What
Changed the
TxGetNaturalSize()flag fromTXTNS_FITTOCONTENTWSPtoTXTNS_FITTOCONTENTinWindowsTextInputComponentView.cpp:This ensures content size reflects actual text dimensions without phantom trailing space, eliminating unwanted vertical gaps and premature wrapping.
Screenshots
None required—behavioral fix without visual API changes.
Testing
Existing e2e test suite covers multiline TextInput behavior across various configurations (text selection, alignment, scrolling, submit behaviors). The surgical nature of this change (single flag modification) maintains compatibility with all existing test scenarios.
Changelog
Should this change be included in the release notes: yes
Fixed multiline TextInput showing excessive blank space and premature text wrapping by correcting content size calculation to exclude trailing whitespace.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Microsoft Reviewers: Open in CodeFlow