Skip to content

Commit

Permalink
Merge pull request #195 from BoomTech-LLC/PF-307-fields-issues
Browse files Browse the repository at this point in the history
PF-307 fix: fixed canva update for shrink
  • Loading branch information
Tigran0199 authored Sep 17, 2024
2 parents 9a3f590 + 3757036 commit 390b8c6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Body/Fields/Signature/Signature.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ import React, { useState, useEffect, useCallback, Fragment, useRef } from 'react
import SignatureCanvas from 'react-signature-canvas'
import { Custom, Input } from 'boomform'

const Signature = (props) => {
const { id, initial, validation, clearBtnContent = 'Clear' } = props
const Signature = props => {
const {
id,
initial,
validation,
clearBtnContent = 'Clear',
classnameprefix
} = props
const [sigPadRef, setSigPadRef] = useState(null)
const canvasContainerRef = useRef(null)
const [canvasWidth, setCanvasWidth] = useState(0)
Expand All @@ -21,7 +27,7 @@ const Signature = (props) => {
return () => {
window.removeEventListener('resize', getParentWidth)
}
}, [])
}, [classnameprefix])

useEffect(() => {
if (initial && sigPadRef) sigPadRef.fromData(initial.data)
Expand Down

0 comments on commit 390b8c6

Please sign in to comment.