RadzenSecurityCode component - invalid index access when copy and pasting #1871

Closed
opened 2026-01-29 17:59:38 +00:00 by claunia · 0 comments
Owner

Originally created by @MBussey93 on GitHub (Sep 25, 2025).

Describe the bug
With the RadzenSecurityCode comonent if copy and pasting a string that is longer than the number of input boxes, Radzen[id].inputs[i] will be undefined once i exceeds the length, causing an error.

Radzen.Blazor.js -> createSecurityCode function -> LINE 373 Radzen[id].inputs[i].value = value[i]; is the issue.

Suggested fix: Check the length of the input field.
LINE 369 for (var i = 0; i < value.length && i < Radzen[id].inputs.length; i++) {

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'RadzenSecurityCode component, copy a code that is larger than the Length of the field and paste it in the field.'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Alternatively link your repo with a sample project that can be run.

Expected behavior
provided string is truncated to the length of the security code input field

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Originally created by @MBussey93 on GitHub (Sep 25, 2025). <!-- IMPORTANT: Read this first!!! 1. If you own a Radzen Professional or Еnterprise subscription you can report your issue or ask us a question via email at info@radzen.com. Radzen staff will reply within 24 hours (Professional) or 16 hours (Enterprise) 2. The Radzen staff guarantees a response to issues in this repo only to paid subscribers. 3. If you have a HOW TO question start a new forum thread in the Radzen Community forum: https://forum.radzen.com. Radzen staff will close issues that are HOWTO questions. 4. Please adhere to the issue template. Specify all the steps required to reproduce the issue or link a project which reproduces it easily (without requiring extra steps such as restoring a database). --> **Describe the bug** With the RadzenSecurityCode comonent if copy and pasting a string that is longer than the number of input boxes, Radzen[id].inputs[i] will be undefined once i exceeds the length, causing an error. Radzen.Blazor.js -> createSecurityCode function -> LINE 373 Radzen[id].inputs[i].value = value[i]; is the issue. Suggested fix: Check the length of the input field. LINE 369 for (var i = 0; i < value.length && i < Radzen[id].inputs.length; i++) { **To Reproduce** Steps to reproduce the behavior: 1. Go to 'RadzenSecurityCode component, copy a code that is larger than the Length of the field and paste it in the field.' 2. Click on '....' 3. Scroll down to '....' 4. See error Alternatively link your repo with a sample project that can be run. **Expected behavior** provided string is truncated to the length of the security code input field **Screenshots** If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - OS: [e.g. iOS] - Browser [e.g. chrome, safari] - Version [e.g. 22] **Additional context** Add any other context about the problem here.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1871