Dismissing SfPicker by tapping outside the popup, causes the app to hang, Android only
We are noticing that tapping outside of the SF picker to dismiss the picker causes the app to hang. This appears to only happen on Android, not on iOS. Is there a way to block users from dismissing the popup in this way? In other words, can they be forced to use the OK or Cancel buttons?
Hi Robin,
We have checked the issue regarding the application hanging when tapping outside the popup to close it. Upon testing with a simple sample, we observed that it worked as expected in our end, and no hanging issue was encountered.
Additionally, we verified the behavior of closing the picker popup using the Ok button, and it also functioned as expected and you can use this also for closing the picker popup.
Tested details:
Device – POCO X5 Pro 5G
Tested Syncfusion version – 27.2.5
For your reference, we have attached a sample and a video demonstrating our results. If possible, could you kindly share a video showing the hanging issue or modify the attached sample to reproduce the problem? This would greatly assist us in analyzing the issue further and providing a solution promptly.
Regarding Query: Is there a way to block users from dismissing the popup in this way?
By using the Closing event, you can block the user from dismissing the popup. Please find the code snippet for the same.
Code snippet:
|
<StackLayout> <Button x:Name="button" Text="Click to open picker" Clicked="button_Clicked"/> <picker:SfPicker x:Name="picker" Mode="Dialog" IsOpen="False" OkButtonClicked="picker_OkButtonClicked" Closing="picker_Closing"> <picker:SfPicker.FooterView> <picker:PickerFooterView Height="40"/> </picker:SfPicker.FooterView> </picker:SfPicker> </StackLayout>
{ bool okClicked= false; public MainPage() { InitializeComponent(); ObservableCollection<object> cityName = new ObservableCollection<object>(); cityName.Add("Chennai"); cityName.Add("Mumbai"); cityName.Add("Delhi"); cityName.Add("Kolkata"); cityName.Add("Bangalore"); cityName.Add("Hyderabad"); cityName.Add("Pune"); cityName.Add("Ahmedabad"); cityName.Add("Jaipur"); cityName.Add("Lucknow"); cityName.Add("Chandigarh"); PickerColumn pickerColumn = new PickerColumn() { HeaderText = "Select City", ItemsSource = cityName, SelectedIndex = 1, }; this.picker.Columns.Add(pickerColumn); } private void picker_OkButtonClicked(object sender, EventArgs e) { okClicked = true; picker.IsOpen = false;
}
private void button_Clicked(object sender, EventArgs e) { picker.IsOpen = true; }
private void picker_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (!okClicked) { e.Cancel = true; } okClicked = false; } } |
We hope that this helps you. Please let us know if you need further assistance.
Regards ,
Indumathi R
Attachment: PickerHangIssue_2ee762c7.zip
- 1 Reply
- 2 Participants
-
RS Robin Schroeder
- Dec 10, 2024 10:11 PM UTC
- Dec 11, 2024 06:07 AM UTC