Skip to content

Commit

Permalink
Merge branch 'canary' into remove-react-modes-config
Browse files Browse the repository at this point in the history
  • Loading branch information
devknoll authored Apr 23, 2021
2 parents 590aae9 + a9d2f2f commit 072a952
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/1.bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Bug Report
description: Create a bug report for the Next.js core
title: 'Bug Report'
labels: 'template: bug'
body:
- type: markdown
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/2.example_bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Example Bug Report
description: Create a bug report for the examples
title: 'Example Bug Report'
labels: 'type: example,template: bug'
body:
- type: markdown
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/3.feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Feature Request
description: Create a feature request for the Next.js core
title: 'Feature Request'
labels: 'template: story'
body:
- type: markdown
Expand Down
8 changes: 7 additions & 1 deletion test/integration/link-ref/pages/click-away-race-condition.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ const useClickAway = (ref, onClickAway) => {
el && !el.contains(event.target) && onClickAway(event)
}

document.addEventListener('click', handler)
let timeoutID = setTimeout(() => {
timeoutID = null
document.addEventListener('click', handler)
}, 0)

return () => {
if (timeoutID != null) {
clearTimeout(timeoutID)
}
document.removeEventListener('click', handler)
}
}, [onClickAway, ref])
Expand Down

0 comments on commit 072a952

Please sign in to comment.