Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

await MaterialDialog.Instance.AlertAsync not waiting

Đang mở
#392 0 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
csharp
Lĩnh vực
mobile-dev

Hướng nghiên cứu

Bắt đầu trong XF.Material/UI/Dialogs/MaterialAlertDialog.xaml.cs, tại các triển khai AlertAsync và ConfirmAsync được liên kết trong issue, bằng cách so sánh task mà mỗi phương thức trả về. Tái hiện hành vi của Android với AlertAsync và xác minh rằng bên gọi chỉ tiếp tục sau khi hộp thoại được đóng; hoàn tất khi AlertAsync chờ giống như ConfirmAsync.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

🐛 Bug Report

A call to await MaterialDialog.Instance.AlertAsync does not wait unitl the dialog's dismiss before continuing.

Doing some tests, calling var msgResult = await MaterialDialog.Instance.ConfirmAsync actually waits so I looked at the code to see what the differences are.
I think the problem is due to the way the dialog is shown on the AlertAsync: in AlertAsync the task returned is the one from await dialog.ShowAsync
https://github.com/Baseflow/XF-Material-Library/blob/589fcf485576d2717e6090789aeb17ed75e2a140/XF.Material/UI/Dialogs/MaterialAlertDialog.xaml.cs#L43

On ConfirmAsync the returned task is the one from InputTaskCompletionSource which is fired only after a button press
https://github.com/Baseflow/XF-Material-Library/blob/589fcf485576d2717e6090789aeb17ed75e2a140/XF.Material/UI/Dialogs/MaterialAlertDialog.xaml.cs#L61

For now a workaround is just to call ConfirmAsync instead of AlertAsync and setting dismissiveText to null, with this we have basically the same funcionality of AlertAsync.

Configuration

Version: 1.7.5

Platform:

  • 📱 iOS
  • 🤖 Android
  • 🏁 WPF
  • 🌎 UWP
  • 🍎 MacOS
  • 📺 tvOS
  • 🐒 Xamarin.Forms
Ngôn ngữ chính
C#
Star
631
Fork
150
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Baseflow/XF-Material-Library

Tất cả issue của Baseflow/XF-Material-Library

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.