diff --git a/public/components/common/search/search.tsx b/public/components/common/search/search.tsx index 4032744f4..a7d75d59d 100644 --- a/public/components/common/search/search.tsx +++ b/public/components/common/search/search.tsx @@ -113,7 +113,12 @@ export const Search = (props: any) => { handleQuerySearch={handleQuerySearch} dslService={dslService} /> - showFlyout()}> + showFlyout()} + onClickAriaLabel={"pplLinkShowFlyout"} + > PPL diff --git a/public/components/explorer/log_explorer.tsx b/public/components/explorer/log_explorer.tsx index a5092affc..51cafe1f8 100644 --- a/public/components/explorer/log_explorer.tsx +++ b/public/components/explorer/log_explorer.tsx @@ -47,13 +47,14 @@ export const LogExplorer = ({ const queryRef = useRef(); const tabIdsRef = useRef(); const explorerDataRef = useRef(); + const curSelectedTabIdRef = useRef(); queryRef.current = queries; tabIdsRef.current = tabIds; explorerDataRef.current = explorerData; + curSelectedTabIdRef.current = curSelectedTabId; const [tabCreatedTypes, setTabCreatedTypes] = useState({}); - // Append add-new-tab link to the end of the tab list, and remove it once tabs state changes useEffect(() => { const addNewLink = $('+ Add new').on('click', () => { @@ -78,8 +79,9 @@ export const LogExplorer = ({ } const index: number = tabIds.indexOf(TabIdToBeClosed); + const curSelectedTab = curSelectedTabIdRef.current; let newIdToFocus = ''; - if (TabIdToBeClosed === curSelectedTabId) { + if (TabIdToBeClosed === curSelectedTab) { if (index === 0) { newIdToFocus = tabIds[index + 1]; } else if (index > 0) {