Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

await MaterialDialog.Instance.AlertAsync not waiting

オープン
#392 コメント 0 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
csharp
領域
mobile-dev

調査の方向性

XF.Material/UI/Dialogs/MaterialAlertDialog.xaml.cs の、issue でリンクされている AlertAsync と ConfirmAsync の実装から始め、それぞれのメソッドが返す task を比較します。AlertAsync で Android の動作を再現し、ダイアログが閉じられた後にのみ呼び出し元が再開することを確認します。AlertAsync が ConfirmAsync と同様に待機すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

🐛 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
主要言語
C#
スター
633
フォーク
150
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Baseflow/XF-Material-Library のほかの issue

Baseflow/XF-Material-Library の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。