Skip to content

Commit 7ee29f4

Browse files
committed
fix: Persist the click event when handling beforeOnClick
1 parent b9ddfe8 commit 7ee29f4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ShareButton.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ export default class ShareButton<LinkOptions> extends Component<Props<LinkOption
155155
event.preventDefault();
156156

157157
if (beforeOnClick && !ignoreBeforeOnClick) {
158+
// Make the event object usuable in the following handleClick call
159+
event.persist();
160+
158161
const returnVal = beforeOnClick();
159162

160163
if (isPromise(returnVal)) {

0 commit comments

Comments
 (0)