BitPhoneInput leaves its Value empty when the number is typed in Persian or Arabic digits
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- csharp
- Área
- frontend, internationalization
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C#
- Estrellas
- 1.4k
- Forks
- 264
- Merge medio
- 5 h 40 min
- PR fusionados (30 d)
- 489
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bitfoundation/bitplatform
-
Bug: Duplicate scrollbars in NotificationCenter after rapidly creating multiple notificationsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
bitfoundation/bitplatform#15606 ·
Los mantenedores suelen responder en 1 día
-
EveryListedPageBecomesInteractiveWithoutAnError fails on WebKit when the PDF viewer starts a fetch while it is leftPosiblemente ocupada @msynk la tomó hoy. Abierto
bitfoundation/bitplatform#15604 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Blex's circuit pause E2E test pauses while BlexProvider's start still has JS calls in flightPosiblemente ocupada @msynk la tomó hoy. Abiertoarea / blex
bitfoundation/bitplatform#15602 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Brouter's and Bmage's MCP tools leave out double, float and MaxFileSizePosiblemente ocupada @msynk la tomó hoy. Abierto
bitfoundation/bitplatform#15601 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Version 11.0.0Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 40/100
bitfoundation/bitplatform#15598 ·
Los mantenedores suelen responder en 1 día
Todos los issues de bitfoundation/bitplatform
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
unoplatform/uno#27025 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
valkey-io/valkey-glide#7975 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
voltern-org/starling#214 ·
Los mantenedores suelen responder en 1 día
-
needs-investigation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Azure/azure-cosmos-dotnet-v3#6255 ·
Los mantenedores suelen responder en 6 días
-
[Docs]: winapp-signing skill says `cert install` uses Trusted Root, but it uses Trusted PeopleAbiertodocumentation
Dificultad 1/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día