Set UIA Name and HelpText properties on TextInput to match placeholder prop value #12186
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
Set the UIA Name property on a TextInput component to match the value of the
placeholder
property on the TextInput.Type of Change
Why
Following the guidelines in the Edit control type documentation, which is the control type for TextInput, the Name property should be set by a static text label, or by the application developer (which is when
accessibilityLabel
is set). In the event that there is no accessibilityLabel property set, the name value defaults to the placeholder text. If there is no accessibilityLabel or placeholder property set, then the UIA Name property will be left unpopulated.The documentation also says that when a placeholder prop is set, the HelpText UIA property should be set to the value of the placeholder. In the event that the accessibilityHint property is not set, the HelpText property will be set to the placeholder value. If there is no accessibilityLabel or placeholder property set, then the UIA HelpText property will be left unpopulated.
What
Added code to set UIA Name and HelpText properties to placeholder value of TextInput
Screenshots
Before:


After:
Testing
Tested changes locally on the TextInput example page in RNTester on playground-composition.
Changelog
Yes
Set UIA Name and HelpText properties on TextInput to match placeholder prop value
Microsoft Reviewers: Open in CodeFlow