diff --git a/src/common/SharePrompt/SharePrompt.js b/src/common/SharePrompt/SharePrompt.js index bdda59f99..2fd906d0c 100644 --- a/src/common/SharePrompt/SharePrompt.js +++ b/src/common/SharePrompt/SharePrompt.js @@ -15,18 +15,17 @@ const SharePrompt = ({ className, url }) => { inputRef.current.select(); } }, []); - const copyToClipboard = React.useCallback((event) => { + const copyToClipboard = React.useCallback(() => { if (inputRef.current !== null) { inputRef.current.select(); document.execCommand('copy'); - event.target.focus(); } }, []); React.useEffect(() => { if (routeFocused && inputRef.current !== null) { inputRef.current.select(); } - }, []); + }, [routeFocused]); return (
diff --git a/src/common/SharePrompt/styles.less b/src/common/SharePrompt/styles.less index 9bf5cf271..a4ee2b3b3 100644 --- a/src/common/SharePrompt/styles.less +++ b/src/common/SharePrompt/styles.less @@ -61,16 +61,6 @@ margin-top: 1rem; background-color: @color-surface-light2; - &:hover { - .url-text-input { - background-color: @color-surface-light4; - } - - .copy-button { - background-color: @color-accent3-light2; - } - } - .url-text-input { flex: 1; align-self: stretch; @@ -91,6 +81,10 @@ padding: 1rem; background-color: @color-accent3; + &:hover { + background-color: @color-accent3-light2; + } + &:focus { outline-color: @color-background-dark5; }