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 (

@@ -34,9 +47,12 @@ export function LastVisited(): ReactElement { { - actions.setActiveTree(guide.tree); - guide.nodePath.forEach((node: any) => actions.updateActiveNode(node)); - document.body.focus(); + lastVisitedLinkHandler(guide); + }} + onKeyDown={(event) => { + if (event.key === 'Enter') { + lastVisitedLinkHandler(guide); + } }}> {guideTitle}