"TextEntry is the house control, not HTML input"
- You use
<input onchange=@(e => ...)>in a razor panel — it compiles (the AspNetCore.Components types are real) but doesn't behave like engine UI. - Enter key submission doesn't work, or you're unsure how to wire it.
s&box's UI layer uses its own TextEntry component, not standard HTML <input>. While Blazor's <input> types compile because the underlying AspNetCore.Components references exist, the engine's own panels (addons/base, addons/menu) all use TextEntry with a different event model.
Use TextEntry with onsubmit for Enter handling:
<TextEntry MaxLength=@maxLen onsubmit=@OnSubmit />void OnSubmit()
{
// Fires when user presses Enter
// Text is available via the event
}Use OnTextEdited for live keystroke updates:
void OnTextEdited(string newText)
{
// Fires on every keystroke
// NOT a Blazor ChangeEventArgs — it's a plain string
}How it works internally: TextEntry.OnButtonTyped fires CreateEvent("onsubmit", Text) on Enter. Razor binds it the same way as onclick — onsubmit=@Method takes a plain no-arg Action.
Engine references to verify against:
addons/base/code/UI/Chat/ChatPanel.razor—TextEntrywithonsubmitaddons/menu/code/MainSearchBar.razor— live search withOnTextEdited
The engine's razor runtime maps element attributes to component properties and routes custom events (onsubmit) through its own event system, not the browser DOM. TextEntry handles focus, cursor, selection, and Enter detection internally — reimplementing any of that with raw <input> means fighting the engine's own input pipeline. When in doubt, grep addons/base and addons/menu for a working usage before inventing a new pattern.