[PR #1618] [MERGED] RadzenMask: fix unexpected behavior when a character allowed by the pattern is in the mask #2838

Open
opened 2026-01-29 18:20:42 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/radzenhq/radzen-blazor/pull/1618
Author: @Cosmatevs
Created: 7/23/2024
Status: Merged
Merged: 7/24/2024
Merged by: @enchev

Base: masterHead: mask-explicit-characters-fix


📝 Commits (1)

  • 65f31a6 RadzenMask: fix string duplication on typing when a character allowed by the pattern (e.g. 2 is in [0-9]) is in the mask (e.g. "+22 *** *** ***")

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 Radzen.Blazor/wwwroot/Radzen.Blazor.js (+1 -1)

📄 Description

Consider a mask component with these attributes:

Mask="+48 *** *** ***"
CharacterPattern="[0-9]"

Currently, when you type numbers, the value gets duplicated to some extent. Even if you try to backspace characters, this will continue:
Mask current

My change makes the algorithm try to adjust the value not only to *s, but also to explicit characters in the mask:
Mask new


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/radzenhq/radzen-blazor/pull/1618 **Author:** [@Cosmatevs](https://github.com/Cosmatevs) **Created:** 7/23/2024 **Status:** ✅ Merged **Merged:** 7/24/2024 **Merged by:** [@enchev](https://github.com/enchev) **Base:** `master` ← **Head:** `mask-explicit-characters-fix` --- ### 📝 Commits (1) - [`65f31a6`](https://github.com/radzenhq/radzen-blazor/commit/65f31a68ba0d22e45342376a0363d65f1639c231) RadzenMask: fix string duplication on typing when a character allowed by the pattern (e.g. 2 is in [0-9]) is in the mask (e.g. "+22 *** *** ***") ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `Radzen.Blazor/wwwroot/Radzen.Blazor.js` (+1 -1) </details> ### 📄 Description Consider a mask component with these attributes: ``` Mask="+48 *** *** ***" CharacterPattern="[0-9]" ``` Currently, when you type numbers, the value gets duplicated to some extent. Even if you try to backspace characters, this will continue: ![Mask current](https://github.com/user-attachments/assets/91096b38-a4f1-4a0a-b179-b7e367772671) My change makes the algorithm try to adjust the value not only to *s, but also to explicit characters in the mask: ![Mask new](https://github.com/user-attachments/assets/72d44133-bd16-4cfd-99c1-9859dcb78cb6) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 18:20:42 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#2838