diff --git a/public/app/features/dashboard/components/SubMenu/DashboardLinks.tsx b/public/app/features/dashboard/components/SubMenu/DashboardLinks.tsx index d733eab69fe..abab921936b 100644 --- a/public/app/features/dashboard/components/SubMenu/DashboardLinks.tsx +++ b/public/app/features/dashboard/components/SubMenu/DashboardLinks.tsx @@ -44,7 +44,7 @@ export const DashboardLinks: FC = ({ dashboard, links }) => { const linkElement = ( { state: State = { resolvedLinks: [] }; - wrapperRef = createRef(); listItemRef = createRef(); componentDidMount() { @@ -45,7 +44,7 @@ export class DashboardLinksDashboard extends PureComponent { const { link } = this.props; return ( -
+
{link.tooltip && {linkElement}} {!link.tooltip && <>{linkElement}}
@@ -62,7 +61,7 @@ export class DashboardLinksDashboard extends PureComponent { resolvedLinks.map((resolvedLink, index) => { const linkElement = (
{ ); }; - getDropdownLocationCssClass = (): string => { - const [pullLeftCssClass, pullRightCssClass] = ['pull-left', 'pull-right']; - const wrapper = this.wrapperRef.current; - const list = this.listItemRef.current; - if (!wrapper || !list) { - return pullRightCssClass; - } - return wrapper.offsetLeft > list.offsetWidth - wrapper.offsetWidth ? pullRightCssClass : pullLeftCssClass; - }; - - renderDropdown = () => { + renderDropdown() { const { link, linkInfo } = this.props; const { resolvedLinks } = this.state; const linkElement = ( <> - + {linkInfo.title} -