Refactor Captcha Input Rendering in OpenForm Component
- Wrapped the CaptchaInput component in a ClientOnly block to ensure it only renders on the client side, preventing server-side rendering issues. - Added a fallback template with a USkeleton component to provide a loading state while the CaptchaInput is being processed. These changes aim to enhance the user experience by improving the rendering logic of the Captcha input, ensuring it behaves correctly in different environments.
This commit is contained in:
parent
8cb6e1238f
commit
20adfe076f
|
|
@ -57,16 +57,21 @@
|
|||
</transition>
|
||||
|
||||
<!-- Captcha -->
|
||||
<div class="mb-3 px-2 mt-4 mx-auto w-max">
|
||||
<CaptchaInput
|
||||
v-if="form.use_captcha && isLastPage && hasCaptchaProviders && isCaptchaProviderAvailable"
|
||||
ref="captcha"
|
||||
:provider="form.captcha_provider"
|
||||
:form="dataForm"
|
||||
:language="form.language"
|
||||
:dark-mode="darkMode"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<ClientOnly>
|
||||
<div v-if="form.use_captcha && isLastPage && hasCaptchaProviders && isCaptchaProviderAvailable" class="mb-3 px-2 mt-4 mx-auto w-max">
|
||||
<CaptchaInput
|
||||
ref="captcha"
|
||||
:provider="form.captcha_provider"
|
||||
:form="dataForm"
|
||||
:language="form.language"
|
||||
:dark-mode="darkMode"
|
||||
/>
|
||||
</div>
|
||||
<template #fallback>
|
||||
<USkeleton class="h-[78px] w-[304px]" />
|
||||
</template>
|
||||
</ClientOnly>
|
||||
|
||||
<!-- Submit, Next and previous buttons -->
|
||||
<div class="flex flex-wrap justify-center w-full">
|
||||
|
|
|
|||
Loading…
Reference in New Issue