Skip to content

Commit

Permalink
A11y improvements (#130)
Browse files Browse the repository at this point in the history
Adds role to the chat area for screen reader updates
Adds Aria labels to forms and buttons
  • Loading branch information
EHLOVader authored Aug 15, 2024
1 parent c16ee89 commit 095d239
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react/core/src/exports/AiChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export const AiChat: <AiMsg>(
userDefinedGreeting={uiOverrides.Greeting}
/>
</div>
<div className="nlux-conversation-container" ref={conversationContainerRef}>
<div className="nlux-conversation-container" ref={conversationContainerRef} aria-label="Chat conversation" role="log">
<ForwardConversationComp
ref={conversationRef}
segments={segments}
Expand Down
3 changes: 3 additions & 0 deletions packages/react/core/src/sections/Composer/ComposerComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,14 @@ export const ComposerComp = (props: ComposerProps) => {
value={props.prompt}
onChange={handleChange}
onKeyDown={handleKeyDown}
aria-label={props.placeholder}
/>
{!showCancelButton && (
<button
tabIndex={0}
disabled={disableButton}
onClick={() => props.onSubmit()}
aria-label="Send"
>
{showSendIcon && <SendIconComp/>}
{!showSendIcon && props.Loader}
Expand All @@ -93,6 +95,7 @@ export const ComposerComp = (props: ComposerProps) => {
<button
tabIndex={0}
onClick={props.onCancel}
aria-label="Cancel"
>
<CancelIconComp/>
</button>
Expand Down

0 comments on commit 095d239

Please sign in to comment.