Skip to content

Chat send button behavior affects other (injected) buttons due to non-specific selector #137

@DeepanshKhurana

Description

@DeepanshKhurana

When I add a button near the chat input, the send button stops working properly. The chat's enable/disable behavior (blue when typing, gray when empty) gets applied to the wrong button instead of the actual send button.

This happens because the code uses querySelector("button") which just grabs the first button it finds, not necessarily the send button.

The fix is to give the send button a specific CSS class and update the selectors to target that class instead of just "button".

Reasoning

I found it when I was trying to inject a reset button into the text area. I found a workaround in using a styled a tag but it just makes more sense to have a specific selector on the button.

I already have somewhat of a fix and am ready to create a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions