Skip to content

Commit 65d4f37

Browse files
authored
fix(ui): show configured description on active tabs (#8675)
<!-- For external contributors, please include: - A summary of the pull request and any related issues it fixes. - Reasoning for the changes made or any additional context that may be useful. Ensure you have read and understand the [CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md) document in this repository. --> fixes #8672
1 parent 3f128c5 commit 65d4f37

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/ui/src/fields/Tabs/index.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ const TabsFieldComponent: TabsFieldClientComponent = (props) => {
112112
return tabPath
113113
}
114114

115+
const activeTabDescription = activeTabConfig.description
116+
const activeTabStaticDescription =
117+
typeof activeTabDescription === 'function'
118+
? activeTabDescription({ t: i18n.t })
119+
: activeTabDescription
120+
115121
return (
116122
<div
117123
className={[
@@ -154,7 +160,11 @@ const TabsFieldComponent: TabsFieldClientComponent = (props) => {
154160
.filter(Boolean)
155161
.join(' ')}
156162
>
157-
<FieldDescription Description={field?.admin?.components?.Description} field={field} />
163+
<FieldDescription
164+
Description={field?.admin?.components?.Description}
165+
description={activeTabStaticDescription}
166+
field={field}
167+
/>
158168
<RenderFields
159169
fields={activeTabConfig.fields}
160170
forceRender={forceRender}

0 commit comments

Comments
 (0)