MudBlazor/MudBlazor

MudTextField with Mask enabled has unexpected behavior on mobile browsers

Ouverte

#4 487 ouverte le 25 avr. 2022

 (31 commentaires) (5 réactions) (0 personne assignée)C# (1 631 forks)batch import
bugdevice: mobilehas workaroundhelp wanted

Métriques du dépôt

Stars
 (10 394 étoiles)
Métriques de merge PR
 (Merge moyen 6j 6h) (108 PRs mergées en 30 j)

Description

Bug type

Component

Component name

MudMask MudTextField

What happened?

When we set up a MudTextField with a Mask, everything works fine on desktop browsers. If we go to a real mobile browser, it will not get the updated value as we fill. An example is this simple code :

<MudTextField T="string" Label="CEP" Variant="Variant.Outlined" HelperTextOnFocus="true" HelperText="Rua do titular da conta"
                                  InputType="InputType.Text" Mask="@(new PatternMask("00.000-000"))"
                                  Required="true" RequiredError="CEP é obrigatório"> 
 </MudTextField>

This makes the Required property not work correctly. This also impacts Validator behaviour. This is probably connected to events being handled.

Expected behavior

Expected behaviour is when using mask, even on mobile browsers at least the correct value is passed ahead for validators and MudBlazor actions. Ideal behaviour is Mask being applied at least when focus is out or value is detected as changed, since using ValueChanged works pretty OK.

Reproduction link

https://try.mudblazor.com/snippet/QuQmOymJeZQhVpOu

Reproduction steps

  1. Create a MudTextField
  2. Add PatternMask
  3. Enable any validation, like Required or Validation func.
  4. Open on real mobile browser
  5. Fill the MudTextField

Relevant log output

No response

Version (bug)

6.0.10

Version (working)

No response

What browsers are you seeing the problem on?

Chrome, Microsoft Edge

On what operating system are you experiencing the issue?

Android

Pull Request

  • I would like to do a Pull Request

Code of Conduct

  • I agree to follow this project's Code of Conduct

Guide contributeur