diff --git a/packages/@ourworldindata/grapher/src/controls/SettingsMenu.tsx b/packages/@ourworldindata/grapher/src/controls/SettingsMenu.tsx index 98246200474..dcb63bb5677 100644 --- a/packages/@ourworldindata/grapher/src/controls/SettingsMenu.tsx +++ b/packages/@ourworldindata/grapher/src/controls/SettingsMenu.tsx @@ -225,7 +225,9 @@ export class SettingsMenu extends React.Component<{ componentWillUnmount(): void { document.removeEventListener("keydown", this.onDocumentKeyDown) - document.removeEventListener("click", this.onDocumentClick) + document.removeEventListener("click", this.onDocumentClick, { + capture: true, + }) } @action.bound onDocumentKeyDown(e: KeyboardEvent): void {