diff --git a/.changeset/spotty-areas-work.md b/.changeset/spotty-areas-work.md new file mode 100644 index 0000000000..4d90b44fe9 --- /dev/null +++ b/.changeset/spotty-areas-work.md @@ -0,0 +1,5 @@ +--- +'@lg-chat/input-bar': patch +--- + +Add an accessible title to the submit button diff --git a/chat/input-bar/src/InputBar/InputBar.spec.tsx b/chat/input-bar/src/InputBar/InputBar.spec.tsx index 6a358807c2..5969e2a397 100644 --- a/chat/input-bar/src/InputBar/InputBar.spec.tsx +++ b/chat/input-bar/src/InputBar/InputBar.spec.tsx @@ -71,7 +71,7 @@ describe('packages/input-bar', () => { test('fires when enter is clicked', () => { const textarea = screen.getByRole('textbox'); - const sendButton = screen.getByRole('button'); + const sendButton = screen.getByTitle('Send message'); userEvent.type(textarea, testText); userEvent.click(sendButton); diff --git a/chat/input-bar/src/InputBar/InputBar.tsx b/chat/input-bar/src/InputBar/InputBar.tsx index c38f79596e..ea5add6da1 100644 --- a/chat/input-bar/src/InputBar/InputBar.tsx +++ b/chat/input-bar/src/InputBar/InputBar.tsx @@ -433,6 +433,7 @@ export const InputBar = forwardRef( className={cx({ [sendButtonDisabledStyles]: isSendButtonDisabled(), })} + title="Send message" > {shouldRenderButtonText && 'Enter'}