From 910d2d9f6b31f926bdc95c3e95323abccb0996f6 Mon Sep 17 00:00:00 2001 From: Plastikmensch Date: Wed, 4 Jan 2023 11:59:43 +0100 Subject: Prevent doodle from closing on outside click (#2047) Adds a new property to the dispatch, which when set to true, replaces the onClose handler with a no-op, preventing the modal from closing. Signed-off-by: Plastikmensch Signed-off-by: Plastikmensch --- app/javascript/flavours/glitch/features/ui/components/modal_root.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch/features/ui') diff --git a/app/javascript/flavours/glitch/features/ui/components/modal_root.js b/app/javascript/flavours/glitch/features/ui/components/modal_root.js index d2ee28948..379f57cbb 100644 --- a/app/javascript/flavours/glitch/features/ui/components/modal_root.js +++ b/app/javascript/flavours/glitch/features/ui/components/modal_root.js @@ -116,13 +116,16 @@ export default class ModalRoot extends React.PureComponent { this._modal = c; } + // prevent closing of modal when clicking the overlay + noop = () => {} + render () { const { type, props, ignoreFocus } = this.props; const { backgroundColor } = this.state; const visible = !!type; return ( - + {visible && ( <> -- cgit