BitPhoneInput leaves its Value empty when the number is typed in Persian or Arabic digits
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- csharp
調査の方向性
Read BitPhoneInput.razor.cs and locate KeepDigits, ComposeFullNumber and ParseFullNumber; then inspect the shared BitMask handling for its # slot. Compare digit handling with BitNumberField.NormalizeDigits. Done when Persian and Arabic decimal digits produce the expected phone value and work with Strict masking; the linked pull request is already open.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
BitPhoneInput ignores digits that are not ASCII. A number typed on a Persian or Arabic keyboard (۰۹۱۲۱۲۳۴۵۶۷, ٠٩١٢١٢٣٤٥٦٧), or pasted from a text written in those digits, is shown in the input, but Value stays null. A form whose submit button depends on the value (a sign-in page's "send code" button, for example) never enables, and the user cannot tell why.
With Strict, the same digits are discarded as they are typed, so the field stays empty.
Steps to reproduce
<BitPhoneInput @bind-Value="value" DefaultCountry="BitCountries.Iran" Immediate />
<p>Value: @value</p>
@code {
private string? value;
}
- Type
09121234567:Valueis+989121234567. - Clear it and type
۰۹۱۲۱۲۳۴۵۶۷(a Persian keyboard layout on Windows types these from the number row):Valuestays empty.
Seen with Bit.BlazorUI.Extras 11.0.0-pre-10; the code below is the same on develop today (40f9925eb).
Cause
KeepDigits in BitPhoneInput.razor.cs keeps char.IsAsciiDigit characters alone, and the Value is composed from what it keeps (ComposeFullNumber, ParseFullNumber). The # slot of the shared BitMask takes char.IsAsciiDigit too, so a masked field drops them as well.
Expected behavior
Any decimal digit is read as the digit it is, as BitNumberField already does with NormalizeDigits. For example, in KeepDigits (and the same for a mask's # slot):
if (char.IsAsciiDigit(c))
{
builder.Append(c);
}
else if (char.IsDigit(c))
{
builder.Append((char)('0' + (int)char.GetNumericValue(c)));
}
Either always (a phone number is never meant to hold anything but its digits), or behind a NormalizeDigits parameter like BitNumberField's.
Workaround
A capture-phase input listener on window that rewrites [۰-۹٠-٩] into ASCII digits in every input[type=tel] before Blazor reads the value.
- 主要言語
- C#
- スター
- 1.4k
- フォーク
- 264
- 平均マージ
- 5時間 40分
- マージ済み PR(30日)
- 489
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bitfoundation/bitplatform のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
bitfoundation/bitplatform#15606 ·
メンテナーはふだん 1 日以内に返信
-
EveryListedPageBecomesInteractiveWithoutAnError fails on WebKit when the PDF viewer starts a fetch while it is left対応中かも @msynk が今日担当しました。 オープン
bitfoundation/bitplatform#15604 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Blex's circuit pause E2E test pauses while BlexProvider's start still has JS calls in flight対応中かも @msynk が今日担当しました。 オープンarea / blex
bitfoundation/bitplatform#15602 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Brouter's and Bmage's MCP tools leave out double, float and MaxFileSize対応中かも @msynk が今日担当しました。 オープン
bitfoundation/bitplatform#15601 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Version 11.0.0オープン
難易度 1/5 1時間未満 初心者へのやさしさ 40/100
bitfoundation/bitplatform#15598 ·
メンテナーはふだん 1 日以内に返信
bitfoundation/bitplatform の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
unoplatform/uno#27025 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
valkey-io/valkey-glide#7975 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
voltern-org/starling#214 ·
メンテナーはふだん 1 日以内に返信
-
needs-investigation
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Azure/azure-cosmos-dotnet-v3#6255 ·
メンテナーはふだん 6 日以内に返信
-
documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信