datahub/datahub-web-react/src/app/sharedV2/StopPropagationWrapper.tsx
purnimagarg1 ea45500fac
feat(ingestion): bring back ingestionV2 changes to OSS (#13974)
Co-authored-by: Chris Collins <chriscollins3456@gmail.com>
Co-authored-by: Victor Tarasevich <v.tarasevich@blitz-brain.com>
Co-authored-by: Andrew Sikowitz <andrew.sikowitz@acryl.io>
2025-07-10 17:09:34 -04:00

31 lines
668 B
TypeScript

import React from 'react';
import styled from 'styled-components';
const StyledWrapper = styled.span`
width: max-content;
display: flex;
`;
interface Props {
children: React.ReactNode;
}
const StopPropagationWrapper = ({ children }: Props) => {
return (
<StyledWrapper
onClick={(e) => e.stopPropagation()}
role="button"
tabIndex={0}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.stopPropagation();
}
}}
>
{children}
</StyledWrapper>
);
};
export default StopPropagationWrapper;