1import { useEffect } from 'react';
3// via https:// usehooks.com/useOnClickOutside/
5export default function useOnClickOutside(ref, handler) {
7 const listener = event => {
8 // Do nothing if clicking ref's element or descendent elements
9 if (!ref.current || ref.current.contains(event.target)) {
16 document.addEventListener('mousedown', listener);
17 document.addEventListener('touchstart', listener);
20 document.removeEventListener('mousedown', listener);
21 document.removeEventListener('touchstart', listener);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list