Skip to content

Commit 2e0980d

Browse files
authored
Merge pull request #163 from dozro/a11y/message-composing
a11y: message composing
2 parents bdd9934 + 485834b commit 2e0980d

3 files changed

Lines changed: 36 additions & 2 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
sable: patch
3+
---
4+
5+
added a few accessibility tags to the elements involved in message composing

src/app/features/room/RoomInput.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,7 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
828828
variant="SurfaceVariant"
829829
size="300"
830830
radii="300"
831+
title="schedule message send"
831832
>
832833
<Icon src={Icons.Cross} size="50" />
833834
</IconButton>
@@ -853,6 +854,8 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
853854
variant="SurfaceVariant"
854855
size="300"
855856
radii="300"
857+
aria-label="Cancel reply"
858+
title="Cancel reply"
856859
>
857860
<Icon src={Icons.Cross} size="50" />
858861
</IconButton>
@@ -886,6 +889,8 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
886889
variant="SurfaceVariant"
887890
size="300"
888891
radii="300"
892+
title="Upload File"
893+
aria-label="Upload and attach a File"
889894
>
890895
<Icon src={Icons.PlusCircle} />
891896
</IconButton>
@@ -896,6 +901,9 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
896901
variant="SurfaceVariant"
897902
size="300"
898903
radii="300"
904+
title={toolbar ? 'Hide Toolbar' : 'Show Toolbar'}
905+
aria-pressed={toolbar}
906+
aria-label={toolbar ? 'Hide Toolbar' : 'Show Toolbar'}
899907
onClick={() => setToolbar(!toolbar)}
900908
>
901909
<Icon src={toolbar ? Icons.AlphabetUnderline : Icons.Alphabet} />
@@ -940,6 +948,8 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
940948
variant="SurfaceVariant"
941949
size="300"
942950
radii="300"
951+
title="open sticker picker"
952+
aria-label="Open sticker picker"
943953
>
944954
<Icon
945955
src={Icons.Sticker}
@@ -956,6 +966,8 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
956966
variant="SurfaceVariant"
957967
size="300"
958968
radii="300"
969+
title="open emoji picker"
970+
aria-label="Open emoji picker"
959971
>
960972
<Icon
961973
src={Icons.Smile}
@@ -1012,6 +1024,8 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
10121024
/>
10131025
<Box display="Flex" alignItems="Center">
10141026
<IconButton
1027+
title="Send Message"
1028+
aria-label="Send your composed Message"
10151029
onClick={() => {
10161030
if (isLongPress.current) {
10171031
isLongPress.current = false;
@@ -1053,6 +1067,8 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
10531067
onClick={(evt: MouseEvent<HTMLButtonElement>) => {
10541068
setScheduleMenuAnchor(evt.currentTarget.getBoundingClientRect());
10551069
}}
1070+
title="Schedule Message"
1071+
aria-label="Schedule message send"
10561072
variant={scheduledTime ? 'Primary' : 'SurfaceVariant'}
10571073
size="300"
10581074
radii="0"

src/app/features/room/schedule-send/SchedulePickerDialog.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,13 @@ export function SchedulePickerDialog({
9898
<Box grow="Yes">
9999
<Text size="H4">Schedule Send</Text>
100100
</Box>
101-
<IconButton size="300" onClick={onCancel} radii="300">
101+
<IconButton
102+
size="300"
103+
onClick={onCancel}
104+
radii="300"
105+
title="Cancel scheduling"
106+
aria-label="Cancel scheduling"
107+
>
102108
<Icon src={Icons.Cross} />
103109
</IconButton>
104110
</Header>
@@ -243,7 +249,14 @@ export function SchedulePickerDialog({
243249
{error || 'Selected time is in the past'}
244250
</Text>
245251
)}
246-
<Button type="submit" variant="Primary" aria-disabled={isPast} onClick={handleSubmit}>
252+
<Button
253+
type="submit"
254+
variant="Primary"
255+
aria-disabled={isPast}
256+
onClick={handleSubmit}
257+
title="Schedule Send"
258+
aria-label="Schedule send"
259+
>
247260
<Text size="B400">Schedule Send</Text>
248261
</Button>
249262
</Box>

0 commit comments

Comments
 (0)