Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix chat template input form submission on Firefox #6188

Merged
merged 1 commit into from
Mar 25, 2025

Conversation

MackinnonBuck
Copy link
Member

@MackinnonBuck MackinnonBuck commented Mar 24, 2025

The JavaScript-dispatched 'submit' event for the chat input form was uncancellable on Firefox. This meant sending a chat message performed a full POST request that bypasses the interactive form handler, and this fails because the chat template doesn't use prerendering (and even if it did, the behavior would still be wrong).

The solution is to specify the cancelable property as true on the options object used to construct the custom 'submit' event.

Fixes #6150

Microsoft Reviewers: Open in CodeFlow

@MackinnonBuck MackinnonBuck self-assigned this Mar 24, 2025
@MackinnonBuck MackinnonBuck requested a review from a team as a code owner March 24, 2025 22:21
@github-actions github-actions bot added the area-ai-templates Microsoft.Extensions.AI.Templates label Mar 24, 2025
Copy link
Member

@SteveSandersonMS SteveSandersonMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting - thanks for tracking this down!

@SteveSandersonMS SteveSandersonMS merged commit 839a98d into main Mar 25, 2025
7 checks passed
@SteveSandersonMS SteveSandersonMS deleted the mbuck/fix-chat-form-post branch March 25, 2025 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-ai-templates Microsoft.Extensions.AI.Templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chat template: The POST request does not specify which form is being submitted.
2 participants