Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with SfSignaturePad in iOS Unable to Sign When ScrollView is Active #49

Open
Divyesh-Bhatt opened this issue Jun 21, 2024 · 1 comment

Comments

@Divyesh-Bhatt
Copy link

Divyesh-Bhatt commented Jun 21, 2024

<ScrollView>
    <Grid RowDefinitions="Auto, Auto, *, Auto">
    <!--Other controls-->    

    <Border
        Grid.Row="2"
        Stroke="#D2D2D2"
        StrokeShape="RoundRectangle"
        StrokeThickness="{OnPlatform Default=0.5, iOS=1}">
                <sp:SfSignaturePad
                    x:Name="_sfSignaturePad"
                    BackgroundColor="White"
                    DrawCompleted="OnDrawCompleted"
                    MaximumStrokeThickness="{OnPlatform Android=5, iOS=6, WinUI=2.5}"
                    MinimumStrokeThickness="{OnPlatform Android=3, iOS=4, WinUI=1.5}"
                    StrokeColor="#000000" />
    </Border>

    <!--Other controls-->    

    </Grid>

</ScrollView>

Now when I'm rotating the Device in landscape mode the scroll will get active for page, that time when try to sign in SfSignaturePad in iOS its not working, because its considering it as scroll. This happens in portrait mode as well in iOS if page have enough content to make the scrollview scroll active.

So as a work around for this I have added trigger in scrollview like this:

<ScrollView.Triggers>
    <DataTrigger TargetType="ScrollView" Binding="{Binding Path=IsSignaturePadVisible}" Value="True">
        <Setter Property="Orientation" Value="Neither"/>
    </DataTrigger>
    <DataTrigger TargetType="ScrollView" Binding="{Binding Path=IsSignaturePadVisible}" Value="False">
        <Setter Property="Orientation" Value="Vertical"/>
    </DataTrigger>
</ScrollView.Triggers>

But this will not resolve the issue for landscape mode, because in that case the scroll will get disabled. If I remove the trigger logic than scrolling will work but will not able to draw signature in SfSignaturePad in iOS.

Here is the POC that reproduces the bug.
signaturepad issue.zip

Run the app in the iOS and than rotate device in Landscape mode. Try to draw the signature, with vertical stroke and notice the bug.

@Divyesh-Bhatt
Copy link
Author

Divyesh-Bhatt commented Jun 24, 2024

@SuthiYuvaraj do you have idea about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant