-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Needs: Attention 👋Original poster responded to request for feedback, awaiting attention from Microsoft / community.Original poster responded to request for feedback, awaiting attention from Microsoft / community.area:docs-commentCategory: Comment left on bottom of a docs page here: https://docs.microsoft.com/sharepoint/devCategory: Comment left on bottom of a docs page here: https://docs.microsoft.com/sharepoint/devarea:spfxCategory: SharePoint Framework (not extensions related)Category: SharePoint Framework (not extensions related)
Description
If you add onGetErrorMessage
which returns a Promise of an empty string (i.e. it passes validation), the value of the TextField is cleared when you click or Tab away (blur) from the TextField.
Sample Code:
protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {
return {
pages: [
{
header: {
description: strings.PropertyPaneDescription
},
groups: [
{
groupName: strings.BasicGroupName,
groupFields: [
PropertyPaneTextField('description', {
label: strings.DescriptionFieldLabel,
onGetErrorMessage: (): Promise<string> => {
return Promise.resolve('')
}
})
]
}
]
}
]
};
}
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 08aa20fb-4cde-4ea6-8946-d67451e78e55
- Version Independent ID: 3c47f3e6-427a-681d-42c7-db0a821da0e9
- Content: Validate web part property values
- Content Source: docs/spfx/web-parts/guidance/validate-web-part-property-values.md
- Product: sharepoint
- Technology: sharepoint-framework
- GitHub Login: @spdevdocs
- Microsoft Alias: spdevdocs
garrytrinder and kflogdev
Metadata
Metadata
Assignees
Labels
Needs: Attention 👋Original poster responded to request for feedback, awaiting attention from Microsoft / community.Original poster responded to request for feedback, awaiting attention from Microsoft / community.area:docs-commentCategory: Comment left on bottom of a docs page here: https://docs.microsoft.com/sharepoint/devCategory: Comment left on bottom of a docs page here: https://docs.microsoft.com/sharepoint/devarea:spfxCategory: SharePoint Framework (not extensions related)Category: SharePoint Framework (not extensions related)