Issue with SfSignaturePad in iOS Unable to Sign When ScrollView is Active
<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>
When rotating the device to landscape mode, the scroll activates for the page. At this point, trying to sign in the SfSignaturePad in iOS doesn't work because it is interpreted as scrolling. This issue also occurs in portrait mode on iOS if the page has enough content to activate the scroll view.
Current Workaround
I have added a trigger in ScrollView to disable scrolling when the signature pad is visible:
<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>
This workaround disables scrolling when the signature pad is visible, allowing signing in portrait mode but does not resolve the issue in landscape mode, as it disables scrolling altogether. Removing the trigger logic allows scrolling but prevents signing in the SfSignaturePad in both landscape and portrait mode in iOS.
Please check the attached screen recording for further details.
Attachment contains 3 videos
- Without scroll trigger in portrait mode
- Without scroll trigger in Landscape mode
- With scroll trigger in Landscape mode
Attachment: iOS_recordings_2348af17.zip
I have attached the POC that reproduces the bug. 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.
Attachment: signaturepad_issue_b68664cd.zip
Hi Divyesh Bhatt,
We have investigated your query based on the provided information. We already implemented a workaround at the sample level for this issue. However, we are now encountering a framework issue where the ScrollView orientation property is not working fine. We have shared the Github link regarding this issue. We will keep you informed as soon as we receive any updates from the framework team.
GitHub Link : ScrollView Orientation is not changed at Runtime in IOS and MAC · Issue #22111 · dotnet/maui (github.com)
Regards,
Aarthi A.
- 2 Replies
- 2 Participants
-
DB Divyesh Bhatt
- Jun 21, 2024 10:16 AM UTC
- Jun 24, 2024 01:54 PM UTC