react-native-signature-canvas icon indicating copy to clipboard operation
react-native-signature-canvas copied to clipboard

DataUrl not working in some android devices.

Open TikshaK opened this issue 1 year ago • 1 comments

I am using a base64 string as dataurl and bgSrc prop to show the image in the background and each time the modal is opened a new url comes and that is set in dataurl. It works fine in most of the devices (iOS and android) but in some android devices, It is giving issue for the release build. The modal opens and the dataurl Image appears for some time(it blink) and then nothing is there in the background. I tried giving url to key prop as suggested in issue #347 by @YanYuanFE but it gives the same issue. Please help if anybody can![

https://github.com/user-attachments/assets/dd43b0b2-f10d-4a15-9fb1-993950f9fd8f

](url)

    <View
        style={[
            styles.container,
            {
                backgroundColor: "rgba(0,0,0,0.8)",
                justifyContent: "center"
            }
        ]}
        pointerEvents={modalLoader ? 'none' : 'auto'}
    >
        <ActivityIndicator
            style={{
                position: "absolute",
                zIndex: 10,
                alignSelf: "center",
                top: sWidth * 0.95
            }}
            animating={modalLoader}
            size={sWidth * 0.1}
            color={Colors.primaryDark}
        />
        {
            backImg !="" &&

        
        <View
            style={{
                alignSelf: 'center',
                borderWidth: 1,
                width: sWidth * 0.9,
                height: sWidth * 0.9 * (3 / 4),
                justifyContent: "center",
                borderColor: Colors.primaryDark,
            }}
            pointerEvents={modalLoader ? 'none' : 'auto'}
        >

            <TouchableOpacity
                onPressIn={(evt) => handlePress(evt)}
                onLayout={handleLayout}
                style={{
                    width: "100%",
                    height: "100%"
                }}
            >
                {/* {
                    (backImg && backImg != null) &&
                } */}
                <SignatureScreen
                    dotSize={dot}
                    style={{
                        width: "100%",
                        height: "100%"
                    }}
                    // key={backImg}
                    onEnd={handleEnd}
                    onOK={handleOK}
                    onEmpty={handleEmpty}
                    onClear={handleClear}
                    onGetData={handleData}
                    ref={ref}
                    onBegin={(sig) => {
                        ref?.current?.readSignature()
                        setModalLoader(true)
                    }}
                    penColor={dotColor}
                    webStyle={styleButton}
                    dataURL={backImg}
                    bgSrc={backImg}
                    confirmText="Save to gallery"
                />
            </TouchableOpacity>
        </View>

} </View>

TikshaK avatar Oct 03 '24 09:10 TikshaK