We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 12ea34c commit d67ad66Copy full SHA for d67ad66
packages/react-paypal-js-storybook/v6/src/decorators/PayPalProviderDecorator.tsx
@@ -76,12 +76,8 @@ function SdkStatusMonitor({ children }: { children: React.ReactNode }) {
76
}, [loadingStatus]);
77
78
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
- ) {
+ const tag = (e.target as HTMLElement).tagName.toLowerCase();
+ if (tag.endsWith("-button")) {
85
action("button")(
86
"Click event dispatched from the PayPal payment button",
87
);
0 commit comments