docusealco / docuseal-react

Embed Document Signing into React app
https://www.docuseal.com/react-document-signing
MIT License
25 stars 4 forks source link

withDecline does not work #6

Open rosskhanas opened 6 hours ago

rosskhanas commented 6 hours ago

I follow the docs: https://www.docuseal.co/docs/embedded/form#react

My code:

<DocusealForm
        customCss="#expand_form_button, #submit_form_button { background-color: #7BEEB3; border: none; color: #000000; } #submit_form_button:hover { background-color: #7BEEB333; }"
        email={customer.email}
        minimize
        src={submitter.embedSrc}
        withDecline
        withTitle={false}
        onComplete={async () => {}}
        onDecline={() => {}}
      />

Result - no "Decline" button:

image
omohokcoj commented 6 hours ago

Hi @rosskhanas can you please try withDecline={true} - make sure it's the latest react npm version Let me know if it works

rosskhanas commented 5 hours ago

@omohokcoj just tried 1.0.47 and explicitly pass true, it does not work. Here is a piece of HTML:

image
omohokcoj commented 5 hours ago

@rosskhanas are you using react client side render - or maybe some SSR engine? I wonder what happens if you pass withDecline={'true'} ?

rosskhanas commented 5 hours ago

@omohokcoj with the string "true" it works:

image

We use next with server rendering, but this part of the page is a client-only component and is not rendered on a server.

omohokcoj commented 5 hours ago

@rosskhanas it must be related to how your next app renders html attributes with react - by default true and false boolean is rendered explicitly as strings (data-with-decline="true"). But it seems like in your app it's not rendered explicitly - might be related to the nextjs version/configs. Using 'true'/'false' prop strings should solve the issue in your nextjs app