Skip to content

NumericTextBox loses focus when tabbing with ShowClearButton=true (1.0.2) #82

Open

Description

@PureWeen

Summary

With ShowClearButton=true, tabbing out of SfNumericTextBox<decimal?> loses focus to document.body. Pressing Space afterward does not clear the value. Pointer activation of the same clear button works.

The small standalone WebAssembly example below reproduces this without forms, validation, custom JavaScript, or application focus/blur handlers.

Environment

  • Package: Syncfusion.Blazor.Toolkit 1.0.2
  • Target: net10.0; .NET SDK 10.0.401
  • Microsoft.AspNetCore.Components.WebAssembly and DevServer: 10.0.12
  • Windows; Microsoft Edge 152.0.4191.66; browser locale en-US
  • Automated observations used Playwright 1.55.0 keyboard/pointer actions, with a 300 ms pause after focus/Tab, rather than synthetic dispatchEvent calls.

Self-contained reproduction

Using the SDK above, create an empty KeyboardRepro directory containing these four files. The wwwroot directory is a child of that directory.

KeyboardRepro.csproj

<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.12" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.12" PrivateAssets="all" />
    <PackageReference Include="Syncfusion.Blazor.Toolkit" Version="1.0.2" />
  </ItemGroup>
</Project>

Program.cs

using KeyboardRepro;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Syncfusion.Blazor.Toolkit;

var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.Services.AddSyncfusionBlazorToolkit();
builder.RootComponents.Add<App>("#app");
await builder.Build().RunAsync();

App.razor

@using Microsoft.AspNetCore.Components.Web
@using Syncfusion.Blazor.Toolkit.Inputs
@using System.Globalization

<h1>NumericTextBox clear-button keyboard reproduction</h1>
<label for="amount">Amount</label>
<SfNumericTextBox TValue="decimal?" ID="amount" @bind-Value="value"
                  Min="0" Max="100" Step="1" ShowClearButton="true" />
<p>Bound value: <output id="model">@(value?.ToString(CultureInfo.InvariantCulture) ?? "null")</output></p>
<button id="reset" @onclick="() => value = 10m">Reset</button>
<hr />
<label for="native">Native focus control</label>
<input id="native" type="number" value="10" />
<button id="native-after">After native input</button>

@code {
    private decimal? value = 10m;
}

wwwroot\index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <base href="/" />
    <title>NumericTextBox reproduction</title>
    <link rel="icon" href="data:," />
    <link rel="stylesheet" href="_content/Syncfusion.Blazor.Toolkit/styles/fluent.min.css" />
</head>
<body>
    <div id="app">Loading...</div>
    <script src="_framework/blazor.webassembly.js"></script>
</body>
</html>

Run from the KeyboardRepro directory:

dotnet restore .\KeyboardRepro.csproj
dotnet run --project .\KeyboardRepro.csproj --configuration Release -- --urls http://127.0.0.1:5000
  1. Open http://127.0.0.1:5000 and wait for the control to finish initializing. The bound value is 10.
  2. Click the Amount label. Confirm that the numeric input is focused and the clear button is visible; allow the focus update to settle.
  3. Press Tab and let the focus update settle.
  4. Press Space.

Actual behavior

  • After Tab, the recorded active element is BODY, with an empty id, rather than a visible control.
  • After Space, the bound value is still 10.
  • Click the Amount label again, then click the clear button with the pointer: the bound value becomes null.
  • As a control, click Native focus control, then press Tab: focus reaches After native input. Shift+Tab returns to the native input.
  • This minimal run had no captured console errors, page errors, or failed HTTP responses.

Expected behavior

Tab navigation should retain a visible, usable focus target rather than dropping to document.body. The exposed clear button should be keyboard-operable; focusing and activating it should clear the nullable value just as pointer activation does.

Scope

The minimal example above was reproduced in standalone WebAssembly. The same focus/clear symptom was also observed in a larger fixture using Interactive Server, hosted and standalone WebAssembly, and Auto's cold Server and warm WebAssembly visits, in en-US and de-DE.

This concerns the nondefault ShowClearButton=true configuration. It does not establish that every keyboard editing/deletion route fails, a default-configuration WCAG conformance verdict, or a particular implementation root cause.

Related context: #79. This issue reports one component behavior, not a collection of independent bugs inferred from assessment check counts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions