diff --git a/app/components/ContextMenu/MenuItem.js b/app/components/ContextMenu/MenuItem.js index e841949dd8..a82d9222cb 100644 --- a/app/components/ContextMenu/MenuItem.js +++ b/app/components/ContextMenu/MenuItem.js @@ -26,20 +26,29 @@ const MenuItem = ({ hide, ...rest }: Props) => { - // We bind to mousedown instead of onClick here as otherwise menu items do not - // work in Firefox which triggers the hideOnClickOutside handler first via - // mousedown. - const handleMouseDown = React.useCallback( + const handleClick = React.useCallback( (ev) => { if (onClick) { ev.preventDefault(); ev.stopPropagation(); onClick(ev); } + + if (hide) { + hide(); + } }, - [onClick] + [onClick, hide] ); + // Preventing default mousedown otherwise menu items do not work in Firefox, + // which triggers the hideOnClickOutside handler first via mousedown – hiding + // and un-rendering the menu contents. + const handleMouseDown = React.useCallback((ev) => { + ev.preventDefault(); + ev.stopPropagation(); + }, []); + return ( {selected !== undefined && ( <> diff --git a/app/components/Sidebar/components/SidebarLink.js b/app/components/Sidebar/components/SidebarLink.js index 259e209fc2..49be59f9d6 100644 --- a/app/components/Sidebar/components/SidebarLink.js +++ b/app/components/Sidebar/components/SidebarLink.js @@ -1,4 +1,5 @@ // @flow +import { transparentize } from "polished"; import * as React from "react"; import { withRouter, type RouterHistory, type Match } from "react-router-dom"; import styled, { withTheme } from "styled-components"; @@ -145,7 +146,8 @@ const Link = styled(NavLink)` &:focus { color: ${(props) => props.theme.text}; - background: ${(props) => props.theme.black05}; + background: ${(props) => + transparentize("0.25", props.theme.sidebarItemBackground)}; } ${breakpoint("tablet")` diff --git a/app/scenes/Document/components/Editor.js b/app/scenes/Document/components/Editor.js index 3e6cf6a36d..318077333f 100644 --- a/app/scenes/Document/components/Editor.js +++ b/app/scenes/Document/components/Editor.js @@ -33,7 +33,7 @@ type Props = {| @observer class DocumentEditor extends React.Component { @observable activeLinkEvent: ?MouseEvent; - @observable ref = React.createRef