From 43439f65a98fc12005fc95205a241a4277b71d2e Mon Sep 17 00:00:00 2001 From: hardiknai-techm Date: Fri, 1 Oct 2021 20:34:47 +0530 Subject: [PATCH] Open new screen: Screen reader does not pass the 'Copied' information after selecting 'Copy' button. --- src/Explorer/OpenFullScreen.tsx | 8 ++++++-- src/Explorer/Tabs/NotebookV2Tab.ts | 26 +++++++++++++------------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/Explorer/OpenFullScreen.tsx b/src/Explorer/OpenFullScreen.tsx index b36feeb48..c465fb16c 100644 --- a/src/Explorer/OpenFullScreen.tsx +++ b/src/Explorer/OpenFullScreen.tsx @@ -4,6 +4,8 @@ import * as React from "react"; import { useFullScreenURLs } from "../hooks/useFullScreenURLs"; export const OpenFullScreen: React.FunctionComponent = () => { + const [isReadUrlCopy, setIsReadUrlCopy] = React.useState(false); + const [isReadWriteUrlCopy, setIsReadWriteUrlCopy] = React.useState(false); const result = useFullScreenURLs(); if (!result) { return ; @@ -25,8 +27,9 @@ export const OpenFullScreen: React.FunctionComponent = () => { { copyToClipboard(readWriteUrl); + setIsReadWriteUrlCopy(true); }} - text="Copy" + text={isReadWriteUrlCopy ? "Copied" : "Copy"} iconProps={{ iconName: "Copy" }} /> { { + setIsReadUrlCopy(true); copyToClipboard(readUrl); }} - text="Copy" + text={isReadUrlCopy ? "Copied" : "Copy"} iconProps={{ iconName: "Copy" }} /> this.copyNotebook(), commandButtonLabel: copyToLabel, hasPopup: false, @@ -160,7 +160,7 @@ export default class NotebookTabV2 extends NotebookTabBase { { iconSrc: null, iconAlt: kernelLabel, - onCommandClick: () => {}, + onCommandClick: () => { }, commandButtonLabel: null, hasPopup: false, disabled: availableKernels.length < 1, @@ -170,16 +170,16 @@ export default class NotebookTabV2 extends NotebookTabBase { dropdownWidth: 100, children: availableKernels.map( (kernel: KernelSpecsDisplay) => - ({ - iconSrc: null, - iconAlt: kernel.displayName, - onCommandClick: () => this.notebookComponentAdapter.notebookChangeKernel(kernel.name), - commandButtonLabel: kernel.displayName, - dropdownItemKey: kernel.name, - hasPopup: false, - disabled: false, - ariaLabel: kernel.displayName, - } as CommandButtonComponentProps) + ({ + iconSrc: null, + iconAlt: kernel.displayName, + onCommandClick: () => this.notebookComponentAdapter.notebookChangeKernel(kernel.name), + commandButtonLabel: kernel.displayName, + dropdownItemKey: kernel.name, + hasPopup: false, + disabled: false, + ariaLabel: kernel.displayName, + } as CommandButtonComponentProps) ), ariaLabel: kernelLabel, }, @@ -271,7 +271,7 @@ export default class NotebookTabV2 extends NotebookTabBase { { iconSrc: null, iconAlt: null, - onCommandClick: () => {}, + onCommandClick: () => { }, commandButtonLabel: null, ariaLabel: cellTypeLabel, hasPopup: false,