feat: autocomplete API expansion and NiceButton accessibility#29
Merged
Conversation
added 2 commits
June 10, 2026 15:45
Forward the remaining meaningful LabeledEntry/LabelBase properties (FontSize, PlaceholderColor, IsPassword, IsReadOnly, SelectAllOnFocus, Example, ContentPadding, Unit/UnitFontFamily/UnitFontSize/UnitColor) with defaults matching the inner control. (#20) Add SuggestionTextSelector (Func<object,string>) so complex suggestion objects commit the intended text instead of ToString(); falls back to ToString() when unset. (#19) Demo shows the new Example property on the autocomplete control. Closes #20 Closes #19
Announce NiceButton as a button to TalkBack/VoiceOver via handler mappers (Android: AccessibilityNodeInfo.ClassName = android.widget.Button; iOS: UIAccessibilityTraits.Button). The accessible name comes from a new SemanticDescription property, falling back to Text so text buttons need no extra config and icon-only buttons have a documented way to get a name. Closes #15
There was a problem hiding this comment.
Pull request overview
This PR expands the public API surface of LabeledAutoCompleteEntry to better match the composed LabeledEntry/LabelBase, improves committed text behavior when selecting complex suggestion objects, and adds accessibility semantics support for NiceButton (button role + accessible name defaults). It also updates the demo app to showcase one of the new forwarded properties.
Changes:
- Forward additional
LabeledEntry/LabelBase-style bindable properties fromLabeledAutoCompleteEntry(e.g.,FontSize,PlaceholderColor,Example,ContentPadding, unit-related properties). - Add
SuggestionTextSelectorto control how selected suggestion objects are converted into committed text (fallback toToString()). - Add
NiceButton.SemanticDescriptionand platform mappings to expose a button role and default accessible description behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| NiceEntryDemoApp/MainPage.xaml | Demonstrates the new Example property on LabeledAutoCompleteEntry. |
| NiceEntry/NiceButton.cs | Adds accessibility role mapping and a SemanticDescription API for screen readers. |
| NiceEntry/LabeledAutoCompleteEntry.xaml.cs | Adds forwarded bindable properties and SuggestionTextSelector for committed suggestion text. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Give LabeledAutoCompleteEntry.ContentPadding the same platform-specific default as LabelBase so the wrapper honors the same-defaults contract instead of defaulting to Thickness(0). Attach a tap recognizer to the NiceButton layout root, which is the single accessibility element, so screen-reader activation reaches OnTapped. The _tapInFlight guard prevents a sighted tap from firing the command twice.
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.
Samlar minor-issuesen #20, #19 och #15.
#20 — LabeledAutoCompleteEntry vidarebefordrar nu hela det meningsfulla API:t
Tillagda vidarebefordrade properties (defaults matchar inre
LabeledEntry/LabelBase):FontSize,PlaceholderColor,IsPassword,IsReadOnly,SelectAllOnFocus,Example,ContentPadding,Unit,UnitFontFamily,UnitFontSize,UnitColor. Demon visarExamplepå kontrollen.#19 — korrekt text vid val av komplext förslag
Ny
SuggestionTextSelector(Func<object, string>) som plockar strängvärdet ur valt objekt. Faller tillbaka påToString()när den inte är satt (oförändrat beteende för strängförslag).#15 — tillgänglighet på NiceButton
SemanticDescription-property;SemanticProperties.Descriptionsätts automatiskt frånSemanticDescription??Text, så text-knappar läses upp utan extra konfig och ikon-only-knappar får en dokumenterad väg till tillgängligt namn.NiceButton): AndroidAccessibilityNodeInfo.ClassName = android.widget.Button, iOSUIAccessibilityTraits.Button.Bygger rent (0 varningar/fel) för
net10.0-android+net10.0-ios, och demoappen bygger.Closes #20
Closes #19
Closes #15