Open Closed

Shift+Enter does not insert a new line in the ChatClientChat message field (MudBlazor) #10927


User avatar
0
VMPProgramador created

When typing a message in ChatClientChat, pressing Shift+Enter does not insert a new line. The message field behaves as a single-line input instead of allowing multiple lines.

Cause

The AutoGrow property no longer exists as of MudBlazor 9.0.0, which replaced it with InputSizing.Auto.

Symptom

  • AutoGrow is ignored as a parameter and ends up as a plain HTML attribute (autogrow="").
  • The field renders as a single-line input, not as a textarea.
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • In ABP v10.7, the AI Management MudBlazor chat widget (ChatClientChat) ultimately relies on a MudBlazor text input for composing the message. In MudBlazor v9, AutoGrow is removed, and if the input is not explicitly configured to be multi-line, MudBlazor will render a single-line <input> (so Shift+Enter can’t insert a newline, because there is no <textarea>).

    • Fix: ensure the message composer is rendered as a textarea by configuring it as multi-line. In MudBlazor, the reliable way is to set Lines (or equivalent multi-line setting) on the underlying MudTextField used for the message input.

      • If you are using the ABP-provided ChatClientChat as-is and can’t change its internal markup, the only definitive fix is to override/replace the component (copy source into your project) and update the message field to be multi-line (i.e., Lines="X" so it becomes a <textarea>). After that, Shift+Enter will work normally (and Enter handling can still be kept for “send” logic).
    • Notes for MudBlazor v9 migration:

      • Don’t use AutoGrow anymore (it becomes a stray autogrow="" attribute, exactly as you observed).
      • InputSizing.Auto is about sizing behavior; it does not automatically convert a single-line input to a textarea. You still must configure the field as multi-line.
    • Minimal example of what the message editor should look like inside the chat component (the key part is Lines="3"; increase as needed):

    <MudTextField @bind-Value="_message"
                    Lines="3"
                    Placeholder="Type a message..."
                    Immediate="true" />
    

    Sources:

    • https://abp.io/docs/10.7/modules/ai-management/
    • https://abp.io/docs/10.7/framework/ui/blazor/forms-validation?BlazorUI=MudBlazor

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on October 16, 2026, 14:19
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.