mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-24 05:39:16 +08:00
fix(a11y): restore playground stop label
This commit is contained in:
@ -36,6 +36,9 @@ const ButtonSendWrapper = ({
|
||||
};
|
||||
|
||||
const buttonClasses = cn("form-modal-send-button", getButtonState());
|
||||
const buttonLabel = isBuilding
|
||||
? t("flowBuild.stop")
|
||||
: t("playground.sendButton");
|
||||
|
||||
const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {
|
||||
e.stopPropagation();
|
||||
@ -56,13 +59,9 @@ const ButtonSendWrapper = ({
|
||||
onClick={handleClick}
|
||||
disabled={isLoading}
|
||||
unstyled
|
||||
data-testid="button-send"
|
||||
aria-label={
|
||||
isBuilding ? t("playground.cancelButton") : t("playground.sendButton")
|
||||
}
|
||||
title={
|
||||
isBuilding ? t("playground.cancelButton") : t("playground.sendButton")
|
||||
}
|
||||
data-testid={isBuilding ? "button-stop" : "button-send"}
|
||||
aria-label={buttonLabel}
|
||||
title={buttonLabel}
|
||||
>
|
||||
<div className="flex h-fit w-fit items-center gap-2 text-sm font-medium">
|
||||
{isBuilding ? (
|
||||
|
||||
@ -126,7 +126,7 @@ describe("IOModal chat input wrapper", () => {
|
||||
expect(preventDefaultSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("should_prevent_default_and_move_cursor_to_end_when_space_is_pressed_outside_textarea", () => {
|
||||
it("should_not_prevent_default_when_space_is_pressed_on_group_wrapper", () => {
|
||||
const inputRef = React.createRef<HTMLTextAreaElement>();
|
||||
const fileInputRef = React.createRef<HTMLInputElement>();
|
||||
const realTextarea = document.createElement("textarea");
|
||||
@ -158,8 +158,8 @@ describe("IOModal chat input wrapper", () => {
|
||||
|
||||
const { preventDefaultSpy } = dispatchOn(wrapper, "keydown", { key: " " });
|
||||
|
||||
expect(preventDefaultSpy).toHaveBeenCalled();
|
||||
expect(selectionSpy).toHaveBeenCalledWith(3, 3);
|
||||
expect(preventDefaultSpy).not.toHaveBeenCalled();
|
||||
expect(selectionSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("should_not_prevent_default_on_unrelated_key_outside_textarea", () => {
|
||||
|
||||
Reference in New Issue
Block a user