diff --git a/frontend/src/components/form/StepClaimConfirmation.tsx b/frontend/src/components/form/StepClaimConfirmation.tsx index 223c48d..31fbc81 100644 --- a/frontend/src/components/form/StepClaimConfirmation.tsx +++ b/frontend/src/components/form/StepClaimConfirmation.tsx @@ -123,6 +123,30 @@ export default function StepClaimConfirmation({ onPrev(); } else if (event.data.type === 'claim_form_loaded') { setLoading(false); + // Автоматически подстраиваем высоту iframe после загрузки + if (iframeRef.current) { + try { + const iframe = iframeRef.current; + const iframeDoc = iframe.contentDocument || iframe.contentWindow?.document; + if (iframeDoc) { + const height = Math.max( + iframeDoc.body.scrollHeight, + iframeDoc.body.offsetHeight, + iframeDoc.documentElement.clientHeight, + iframeDoc.documentElement.scrollHeight, + iframeDoc.documentElement.offsetHeight + ); + iframe.style.height = Math.max(height + 50, 800) + 'px'; + } + } catch (e) { + console.warn('Не удалось автоматически подстроить высоту iframe:', e); + } + } + } else if (event.data.type === 'iframe_resize') { + // Обработка запроса на изменение размера от iframe + if (iframeRef.current && event.data.height) { + iframeRef.current.style.height = Math.max(event.data.height + 50, 800) + 'px'; + } } }; @@ -144,17 +168,28 @@ export default function StepClaimConfirmation({ } return ( - +