diff --git a/CHANGELOG.md b/CHANGELOG.md index 83c134899de..2985f89ab3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ **Bug fixes** +- Fixed `EuiTitle` not rendering child classes ([#2926](https://github.com/elastic/eui/pull/2926)) - Fixed building dev & docs on Windows ([#2847](https://github.com/elastic/eui/pull/2847)) - Fixed screen reader discovery issues with `EuiBottomBar` and `EuiControlBar` ([#2861](https://github.com/elastic/eui/pull/2861)) - Fixed a bug in `EuiDataGrid` causing the first cell to autofocus if interactive ([#2872](https://github.com/elastic/eui/pull/2872)) diff --git a/src/components/title/__snapshots__/title.test.tsx.snap b/src/components/title/__snapshots__/title.test.tsx.snap index 0cfa39086dd..91e6a990347 100644 --- a/src/components/title/__snapshots__/title.test.tsx.snap +++ b/src/components/title/__snapshots__/title.test.tsx.snap @@ -9,3 +9,13 @@ exports[`EuiTitle is rendered 1`] = ` Title `; + +exports[`EuiTitle renders children element className 1`] = ` +

+ Title +

+`; diff --git a/src/components/title/title.test.tsx b/src/components/title/title.test.tsx index 48ea7b746ee..828298a3118 100644 --- a/src/components/title/title.test.tsx +++ b/src/components/title/title.test.tsx @@ -14,4 +14,14 @@ describe('EuiTitle', () => { expect(component).toMatchSnapshot(); }); + + test('renders children element className', () => { + const component = render( + +

Title

+
+ ); + + expect(component).toMatchSnapshot(); + }); }); diff --git a/src/components/title/title.tsx b/src/components/title/title.tsx index ac061f2131c..f53db35d57e 100644 --- a/src/components/title/title.tsx +++ b/src/components/title/title.tsx @@ -39,7 +39,8 @@ export const EuiTitle: FunctionComponent = ({ 'euiTitle', titleSizeToClassNameMap[size], textTransform ? textTransformToClassNameMap[textTransform] : undefined, - className + className, + children.props.className ); const props = {