diff options
Diffstat (limited to 'packages/renderer/src/components/sidebar/ToggleLocationBarButton.tsx')
-rw-r--r-- | packages/renderer/src/components/sidebar/ToggleLocationBarButton.tsx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/renderer/src/components/sidebar/ToggleLocationBarButton.tsx b/packages/renderer/src/components/sidebar/ToggleLocationBarButton.tsx index 7fc559d..c697170 100644 --- a/packages/renderer/src/components/sidebar/ToggleLocationBarButton.tsx +++ b/packages/renderer/src/components/sidebar/ToggleLocationBarButton.tsx | |||
@@ -28,7 +28,7 @@ import React from 'react'; | |||
28 | import { useTranslation } from 'react-i18next'; | 28 | import { useTranslation } from 'react-i18next'; |
29 | 29 | ||
30 | import { useStore } from '../StoreProvider'; | 30 | import { useStore } from '../StoreProvider'; |
31 | import { LOCATION_BAR_ID } from '../locationBar/LocationBar'; | 31 | import { getLocaltionBarID } from '../locationBar/LocationBar'; |
32 | 32 | ||
33 | function ToggleLocationBarIcon({ | 33 | function ToggleLocationBarIcon({ |
34 | loading, | 34 | loading, |
@@ -54,13 +54,17 @@ function ToggleLocationBarButton(): JSX.Element { | |||
54 | const { selectedService } = settings; | 54 | const { selectedService } = settings; |
55 | 55 | ||
56 | return ( | 56 | return ( |
57 | /* eslint-disable react/jsx-props-no-spreading -- Conditionally set the aria-controls prop. */ | ||
57 | <IconButton | 58 | <IconButton |
58 | disabled={!canToggleLocationBar} | 59 | disabled={!canToggleLocationBar} |
59 | aria-pressed={locationBarVisible} | 60 | aria-pressed={locationBarVisible} |
60 | aria-controls={LOCATION_BAR_ID} | 61 | {...(selectedService === undefined |
62 | ? {} | ||
63 | : { 'aria-controls': getLocaltionBarID(selectedService) })} | ||
61 | aria-label={t('toolbar.toggleLocationBar')} | 64 | aria-label={t('toolbar.toggleLocationBar')} |
62 | onClick={() => settings.toggleLocationBar()} | 65 | onClick={() => settings.toggleLocationBar()} |
63 | > | 66 | > |
67 | {/* eslint-enable react/jsx-props-no-spreading */} | ||
64 | <ToggleLocationBarIcon | 68 | <ToggleLocationBarIcon |
65 | loading={selectedService?.loading ?? false} | 69 | loading={selectedService?.loading ?? false} |
66 | show={locationBarVisible} | 70 | show={locationBarVisible} |