From 2b054b835c552702af35f1ac3b6b9622af4b07d1 Mon Sep 17 00:00:00 2001 From: Christos Koutsiaris Date: Wed, 29 Nov 2023 21:09:03 +0000 Subject: [PATCH] fix(ga): a11y issues (#580) * fix(ga): a11y issues * fix(ga): a11y issues --------- Co-authored-by: Christos Koutsiaris --- .changeset/lemon-buckets-deny.md | 6 +++++ .../GuidedAnswerNode/Right/Right.tsx | 5 ++++ .../HomeGrid/Bookmarks/Bookmarks.tsx | 9 ++++++- .../HomeGrid/LastVisited/LastVisited.tsx | 24 +++++++++++++++---- 4 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 .changeset/lemon-buckets-deny.md diff --git a/.changeset/lemon-buckets-deny.md b/.changeset/lemon-buckets-deny.md new file mode 100644 index 00000000..63ef64b8 --- /dev/null +++ b/.changeset/lemon-buckets-deny.md @@ -0,0 +1,6 @@ +--- +'@sap/guided-answers-extension-webapp': patch +'sap-guided-answers-extension': patch +--- + +Fix a11y minor issues diff --git a/packages/webapp/src/webview/ui/components/GuidedAnswerNode/Right/Right.tsx b/packages/webapp/src/webview/ui/components/GuidedAnswerNode/Right/Right.tsx index 13be0387..abaa0556 100644 --- a/packages/webapp/src/webview/ui/components/GuidedAnswerNode/Right/Right.tsx +++ b/packages/webapp/src/webview/ui/components/GuidedAnswerNode/Right/Right.tsx @@ -23,6 +23,11 @@ export function Right(props: { activeNode: GuidedAnswerNodeType }): ReactElement title={command.label} onClick={() => { actions.executeCommand(command); + }} + onKeyDown={(event) => { + if (event.key === 'Enter') { + actions.executeCommand(command); + } }}>
- goToBookmark(bookmark)}> + goToBookmark(bookmark)} + onKeyDown={(event) => { + if (event.key === 'Enter') { + goToBookmark(bookmark); + } + }}> {bookmarkTitle} ((state) => state.lastVisitedGuides); + + /** + * Handles the event for the last visited link in a guided answer interface. + * + * @param {LastVisitedGuide} guide - An object representing the last visited guide, + * which includes the guided answer tree, the path of nodes visited, and the creation timestamp. + */ + function lastVisitedLinkHandler(guide: LastVisitedGuide) { + actions.setActiveTree(guide.tree); + guide.nodePath.forEach((node: GuidedAnswerNode) => actions.updateActiveNode(node)); + document.body.focus(); + } + return (