Skip to content

Commit 32907fb

Browse files
rvsiaHyperkid123
authored andcommitted
PF4 tab: Wrap string titles in <TabTitle>
1 parent a3ab774 commit 32907fb

File tree

1 file changed

+2
-2
lines changed
  • packages/pf4-component-mapper/src/files

1 file changed

+2
-2
lines changed

packages/pf4-component-mapper/src/files/tabs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
22
import PropTypes from 'prop-types';
33
import { useFormApi } from '@data-driven-forms/react-form-renderer';
44

5-
import { Tab, Tabs } from '@patternfly/react-core';
5+
import { Tab, Tabs, TabTitleText } from '@patternfly/react-core';
66

77
const FormTabs = ({ fields, dataType, validate, component, ...rest }) => {
88
const formOptions = useFormApi();
@@ -15,7 +15,7 @@ const FormTabs = ({ fields, dataType, validate, component, ...rest }) => {
1515

1616
const renderTabItems = (fields) =>
1717
fields.map(({ fields, title, name }, index) => (
18-
<Tab key={name} eventKey={index} title={title}>
18+
<Tab key={name} eventKey={index} title={typeof title === 'string' ? <TabTitleText>{title}</TabTitleText> : title}>
1919
<div className="pf-c-form">{formOptions.renderForm(fields, formOptions)}</div>
2020
</Tab>
2121
));

0 commit comments

Comments
 (0)