diff --git a/packages/react-core/src/components/Chip/Chip.tsx b/packages/react-core/src/components/Chip/Chip.tsx index 55d8b867150..ae95d143358 100644 --- a/packages/react-core/src/components/Chip/Chip.tsx +++ b/packages/react-core/src/components/Chip/Chip.tsx @@ -83,7 +83,7 @@ export class Chip extends React.Component { }); renderOverflowChip = () => { - const { children, className, onClick, ouiaId } = this.props; + const { children, className, onClick, ouiaId, ...props } = this.props; const Component = this.props.component as any; return ( { className={css(styles.chip, styles.modifiers.overflow, className)} {...(this.props.component === 'button' ? { type: 'button' } : {})} {...getOUIAProps('OverflowChip', ouiaId !== undefined ? ouiaId : this.state.ouiaStateId)} + {...props} > {children} @@ -102,7 +103,7 @@ export class Chip extends React.Component { }; renderInnerChip(id: string) { - const { children, className, onClick, closeBtnAriaLabel, isReadOnly, component, ouiaId } = this.props; + const { children, className, onClick, closeBtnAriaLabel, isReadOnly, component, ouiaId, ...props } = this.props; const Component = component as any; return ( { className={css(styles.chip, className)} {...(this.state.isTooltipVisible && { tabIndex: 0 })} {...getOUIAProps(Chip.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId)} + {...props} > {children} diff --git a/packages/react-core/src/components/Chip/__tests__/Chip.test.tsx b/packages/react-core/src/components/Chip/__tests__/Chip.test.tsx index df9dde4fc45..56e178e1b4b 100644 --- a/packages/react-core/src/components/Chip/__tests__/Chip.test.tsx +++ b/packages/react-core/src/components/Chip/__tests__/Chip.test.tsx @@ -47,4 +47,13 @@ describe('Chip', () => { ); expect(asFragment()).toMatchSnapshot(); }); + + test("with role='gridcell'", () => { + const { asFragment } = render( + + I'm a roled chip + + ); + expect(asFragment()).toMatchSnapshot(); + }); }); diff --git a/packages/react-core/src/components/Chip/__tests__/__snapshots__/Chip.test.tsx.snap b/packages/react-core/src/components/Chip/__tests__/__snapshots__/Chip.test.tsx.snap index 3cf7ee49a22..bd90c6b3076 100644 --- a/packages/react-core/src/components/Chip/__tests__/__snapshots__/Chip.test.tsx.snap +++ b/packages/react-core/src/components/Chip/__tests__/__snapshots__/Chip.test.tsx.snap @@ -7,6 +7,8 @@ exports[`Chip closable 1`] = ` data-ouia-component-id="OUIA-Generated-Chip-2" data-ouia-component-type="PF4/Chip" data-ouia-safe="true" + id="chip_one" + tooltipposition="top" >
`; + +exports[`Chip with role='gridcell' 1`] = ` + +
+ + I'm a roled chip + + +
+
+`; diff --git a/packages/react-core/src/components/ChipGroup/__tests__/__snapshots__/ChipGroup.test.tsx.snap b/packages/react-core/src/components/ChipGroup/__tests__/__snapshots__/ChipGroup.test.tsx.snap index 6cbf8fe1ed6..4db703a7a31 100644 --- a/packages/react-core/src/components/ChipGroup/__tests__/__snapshots__/ChipGroup.test.tsx.snap +++ b/packages/react-core/src/components/ChipGroup/__tests__/__snapshots__/ChipGroup.test.tsx.snap @@ -25,6 +25,7 @@ exports[`ChipGroup chip group default 1`] = ` data-ouia-component-id="OUIA-Generated-Chip-1" data-ouia-component-type="PF4/Chip" data-ouia-safe="true" + tooltipposition="top" >