Skip to content

Proposal: Prefix and Suffix Properties for TextBox #784

@mdtauk

Description

@mdtauk

Proposal: Prefix and Suffix properties for TextBox

Summary

These would be templated and stylable content properties for the TextBox control and any controls deriving from it. They would add context to the text being entered, and enable easy formatting of things like URLs, currencies, and units and well as Xaml content such as icons, buttons, ComboBox, etc.

Rationale

During discussion, planning and spec writing for the NumberBox control #483
https://github.com/microsoft/microsoft-ui-xaml-specs/pull/29
One of the features that received a lot of support was the addition of Prefix and Suffix content - which is a feature taken from the Fabric Web TextField control.

Because of the useful-ness of this feature, it was suggested that this feature should make its way to the TextBox itself, and could then be available for NumberBox and other similar controls in the future.

Scope

Capability Priority
Display content within the TextBox before and/or after the Text string Must
Provide default styling for Buttons or ComboBoxes added as content to match the UX Must
The ability to edit the template and/or style of the Prefix and Suffix Must
The ability to append the content to text that is copy and pasted Could
API Priority
Display/Hide Prefix and Suffix. Must

Important Notes

Here are some visual examples of how these properties could look on the TextBox:

image
image

The look for these Prefix and Suffix content is taken from the FabricWeb controls, but using the XAML control metrics.

Notes

  • Note that this concept already exists in Fabric Web. Alignment of design and APIs where able is ideal.

Metadata

Metadata

Assignees

Labels

area-TextBoxTextBox, RichEditBoxfeature proposalNew feature proposalneeds-winui-3Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3)team-ControlsIssue for the Controls team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions