Closed LukeTowers closed 1 year ago
This issue will be closed and archived in 3 days, as there has been no activity in this issue for the last 6 months. If this issue is still relevant or you would like to see it actioned, please respond within 3 days. If this issue is critical for your business, please reach out to us at wintercms@luketowers.ca.
About
There has been some interest expressed in adding support for "prefix / suffix" functionality in backend forms. This issue will act as the design document for the proposed functionality and discussion hub for any comments on the feature.
Potential Use Cases
https://example.com
,example.com
, orhttp://example.com
, you can set it up so that the user-editable part of the input is always justexample.com
and the functionality normalizes the value so that you always receivehttps://example.com
when asking for the value of the field; same with social media user names, phone numbers, etc).Terminology
Desired Functionality
Option 1: Add support for related properties to a preselected list of existing fields:
We would add new properties / options to
number
&text
field types, potentially use the functionality to also improve theemail
field.The properties would be the TO BE DEFINED
Option 2: New InputGroup FormWidget
Provide a new InputGroup FormWidget that would allow
leading / prefix
add-onExisting Examples in the wild:
Current Uses in Winter CMS
The following FormWidgets in Winter already use similar UI features. It is not necessarily important to design this functionality to replace the implementations of these FormWidgets, as we want to design something that can be used for the 80% use case with people continuing to use custom FormWidgets for the 20% use case that is significantly more complex (which covers the majority of the following examples).
ColorPicker
Leading Add-on w/ interactive state, live preview of the selected colour. Popup picker triggered by focus on input element.
DatePicker
Trailing Inline Icon on both input fields, indicates which input is for which part of the date / time data. Popup picker triggered by focus on input element.
FileUpload
Trailing Add-on Button Icon, used to trigger the native fileupload dialog.
IconPicker
Leading Add-on w/ interactive state, live preview of the selected icon. Popup picker triggered by focus on input element.
MediaFinder
Trailing Add-on Button Icon, used to trigger the native fileupload dialog
RecordFinder
Trailing Add-on Button Icon, used to trigger the popup picker.
Sensitive
Trailing Add-on Button Icon w/ interactive state, used to trigger toggling the visibility of the sensitive value.