Skip to content

Commit a29c362

Browse files
committed
feat(Slide): stopClickPropagation bool prop is now accepted
This allows to decide if Slide component should stop click propagation or not. Default value (true) is kept to avoid breaking changes
1 parent c172fa4 commit a29c362

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

packages/orbit-components/src/utils/Slide/index.tsx

+8-3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class Slide extends React.Component<Props, State> {
2323

2424
static defaultProps = {
2525
transitionDuration: "fast",
26+
stopClickPropagation: true,
2627
};
2728

2829
expandTimeout: NodeJS.Timeout | null = null;
@@ -141,9 +142,13 @@ class Slide extends React.Component<Props, State> {
141142
aria-hidden={!expanded}
142143
id={id}
143144
aria-labelledby={ariaLabelledBy}
144-
onClick={ev => {
145-
ev.stopPropagation();
146-
}}
145+
onClick={
146+
this.props.stopClickPropagation
147+
? ev => {
148+
ev.stopPropagation();
149+
}
150+
: undefined
151+
}
147152
>
148153
{children}
149154
</div>

packages/orbit-components/src/utils/Slide/types.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ export interface Props {
1818
readonly ariaLabelledBy?: string;
1919
readonly id?: string;
2020
readonly transitionDuration?: TransitionDuration;
21+
readonly stopClickPropagation?: boolean;
2122
}

0 commit comments

Comments
 (0)