Skip to content

Conversation

@anupriya13
Copy link
Contributor

@anupriya13 anupriya13 commented May 6, 2025

Description

Type of Change

  • New feature (non-breaking change which adds functionality)

Why

What is the motivation for this change? Add a few sentences describing the context and overall goals of the pull request's commits.
[Fabric] Implement maxFontSizeMultiplier in Text Input

Resolves #14638

What

What changes were made to the codebase to solve the bug, add the functionality, etc. that you specified above.
[Fabric] Implement maxFontSizeMultiplier in Text Input

https://reactnative.dev/docs/textinput#maxfontsizemultiplier

Please note waiting for this PR to be merged from upstream to uncomment commented code: facebook/react-native@97cf42f

Implemented as per IOS and Android.

Refer https://github.com/facebook/react-native/blob/e69e35e370a7751d258905e3348fd2b0bb2e93c1/packages/react-native/Libraries/Text/RCTTextAttributes.mm#L249

Screenshots

Add any relevant screen captures here from before or after your changes.

Testing

If you added tests that prove your changes are effective or that your feature works, add a few sentences here detailing the added test scenarios.
Tested in playground and manipulating node_modules file code in TextAttributes.h

Changelog

Should this change be included in the release notes: indicate yes or no Yes

Add a brief summary of the change to use in the release notes for the next release.
[Fabric] Implement maxFontSizeMultiplier in Text Input

@anupriya13 anupriya13 marked this pull request as ready for review May 6, 2025 06:31
@anupriya13 anupriya13 requested a review from a team as a code owner May 6, 2025 06:31
@anupriya13 anupriya13 added Area: TextInput Area: Fabric Support Facebook Fabric New Architecture Broad category for issues that apply to the RN "new" architecture of Turbo Modules + Fabric Workstream: Component Parity Close the parity gap between RNW and RN for core RN components and their supporting APIs. API: Completion labels May 6, 2025
@anupriya13 anupriya13 added the AutoMerge Causes a PR to be automatically merged once all requirements are passed (label drives bot activity) label May 6, 2025
@anupriya13 anupriya13 requested review from a team and acoates-ms May 14, 2025 06:08

// Apply maxFontSizeMultiplier if specified
auto maxFontSizeMultiplier = windowsTextInputProps().textAttributes.maxFontSizeMultiplier;
fontSize *=
Copy link
Contributor

Choose a reason for hiding this comment

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

This presumably changes the size that the text actually renders with. Is this accounted for in the layout? -- Basically I think TextLayoutManager needs to also account for this property to correctly calculate the layout of this text.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh i see. Thats part of the other PR.
Dont we need to get the font size from the layout? How do we get get the actual font size that the layout determined was appropriate?

Copy link
Contributor

Choose a reason for hiding this comment

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

With Text we reuse the same TextLayout object that was modified by TextLayoutManager. For TextInput, I think we'd have to extract the size that was calculated from the TextLayout (or otherwise get it from the TextLayoutManager), so that we can set it on the CHARFORMAT?

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 referred to Android / IOS implementations. Let me get back on this tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@anupriya13 anupriya13 requested a review from acoates-ms June 29, 2025 08:40
@anupriya13 anupriya13 merged commit 068dba7 into microsoft:main Jun 30, 2025
58 checks passed
acoates-ms pushed a commit to acoates-ms/react-native-windows that referenced this pull request Sep 11, 2025
acoates-ms added a commit that referenced this pull request Sep 19, 2025
* Pointer events (#14713)

* PointerEvent fixes

* Change files

* format

* [Fabric] Implement SpellCheck and AutoCorrect for TextInput (#14509)

* Fabric : Added support for selectionColor in TextInput component  (#14743)

* Added support for selectionColor for textInput

* yarn fix and format

* Change files

* Implement adjustsFontSizeToFit property for Text in Fabric (#14519)

* Implementation of adjustFontSizeToFit

* Final Changes using TextLayout

* Lint Issue Fixes

* Change files

* prop change detection added

* review Changes and E2E test cases added

* Lint and Format Changes added

* Test Cases Fix added

* Update SnapShot

* Removed the additional Check for resizing Font

* Updated SnapShot

* Review Changes

* Lint and Format Changes

---------

Co-authored-by: Vineeth K <kvineeth@microsoft.com>

* Text : Added EllipsizeMode for tail and clip alignment  (#14660)

* updated ellipsis to respect tail and clip behaviour , for head , middle follow defaulty tail behaviour

* patched updateTextAlignment method

* Change files

* pathced branch , lint fix , lint format

* updated snapshots

* added layout changes to TextLayoutManager

* lint fix and format

* updated snapshots

* updated snapshot Pressable component

* updated to remove extra text_layout null check

* removed comments

* format and lint:fix

* [Fabric] Implement onContentSizeChange in TextInput (#14785)

* Fix : adjustsFontSizeToFit just redrawing won't recalculate the layout (#14813)

* updated adjustsFontSizeToFit textlayout to nullptr

* Change files

* [Fabric] Implement autoFocus property for TextInput for fabric  (#14816)

* Added fix for AutoFocus

* Change files

---------

Co-authored-by: Harini Malothu <hmalothu@microsoft.com>

* [Fabric] Implementation of accessibilityDescription (#14818)

* Initial Commit for accessibilityDescription

* Change files

* Format Changes

* Updating Snapshot

* [Fabric] Implement maxFontSizeMultiplier in Text Input (#14639)

* [Fabric] Fix for updating accessibility value in UIA (#14858)

* Changes for updating accessibilityValue prop

* Change files

* TextInput should capture mouse on mouse down (#14983)

* TextInput should capture mouse on mouse down

* Change files

* format

* [Fabric] Raising UIA Event if Toggle State Changes in Switch Component (#15023)

* Update Toggle State to Narrator

* Yarn Change

* Review Changes

* Review Changes 2.0

* [Fabric] Add Support for ITextProvider, ITextProvider2, and ITextRangeProvider (#14332)

* Partial Implementation

* Add More Implementation

* More Implementation

* More Implementation

* Add Support for Bounding Rectangles

* Complete Initial Implementation

* Change files

* Code Cleanup

* Code Cleanup

* Update Snapshots + Code Cleanup

* Update Snapshots

* Address Feedback

* Address Feedback

* Update Snapshots

* Fix Tests

---------

Co-authored-by: Jon Thysell <jthysell@microsoft.com>

* [Fabric] Fix for Text and TextInput focus issue with screen readers (#15088)

* Few more implementation of TextRange Provider

* Yarn change

* Update Change file

* Screen reader fails to announce the expand/collapse state of the navigation button (#15106)

* adding UIA event handler changes for navigator

* Change files

* adding ViewComponent chnages for accessibility

* removing unnecessary change file

* Remove vnext/fmt/packages.lock.json

---------

Co-authored-by: Protik Biswas <protikbiswas100@microsoft.com>

* fix

* fix

* Upgrade dotnet version

* Change files

* bump sdk

* bump node

* fix

* fix

* Change files

* fix

* fix

* test

* fix

* fix

* update snapshots

* snapshot

* snapshot

* measureLines

* fix

* snapshot

---------

Co-authored-by: Anupriya Verma <54227869+anupriya13@users.noreply.github.com>
Co-authored-by: Abhijeet Jha <74712637+iamAbhi-916@users.noreply.github.com>
Co-authored-by: Vineeth <66076509+vineethkuttan@users.noreply.github.com>
Co-authored-by: Vineeth K <kvineeth@microsoft.com>
Co-authored-by: Harini Malothu <harinimalothu17@gmail.com>
Co-authored-by: Harini Malothu <hmalothu@microsoft.com>
Co-authored-by: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com>
Co-authored-by: Jon Thysell <jthysell@microsoft.com>
Co-authored-by: Protik Biswas <219775028+protikbiswas100@users.noreply.github.com>
Co-authored-by: Protik Biswas <protikbiswas100@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API: Completion Area: Fabric Support Facebook Fabric Area: TextInput AutoMerge Causes a PR to be automatically merged once all requirements are passed (label drives bot activity) New Architecture Broad category for issues that apply to the RN "new" architecture of Turbo Modules + Fabric Workstream: Component Parity Close the parity gap between RNW and RN for core RN components and their supporting APIs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement maxFontSizeMultiplier property for TextInput in Fabric

4 participants