Skip to content

Commit d67ad66

Browse files
committed
pr feedback: update handleClick selectors
1 parent 12ea34c commit d67ad66

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

packages/react-paypal-js-storybook/v6/src/decorators/PayPalProviderDecorator.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,8 @@ function SdkStatusMonitor({ children }: { children: React.ReactNode }) {
7676
}, [loadingStatus]);
7777

7878
const handleClick = (e: React.MouseEvent) => {
79-
const target = e.target as HTMLElement;
80-
if (
81-
target.closest("[data-paypal-button]") ||
82-
target.closest("paypal-button") ||
83-
target.tagName.toLowerCase().includes("paypal")
84-
) {
79+
const tag = (e.target as HTMLElement).tagName.toLowerCase();
80+
if (tag.endsWith("-button")) {
8581
action("button")(
8682
"Click event dispatched from the PayPal payment button",
8783
);

0 commit comments

Comments
 (0)