From b34def3249b368de336a5c4eadd86318103e78fb Mon Sep 17 00:00:00 2001 From: linusfj Date: Fri, 1 Mar 2024 13:34:19 +0100 Subject: [PATCH] Add conditional rendering for Control button --- new-client/src/plugins/BaseWindowPlugin.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/new-client/src/plugins/BaseWindowPlugin.js b/new-client/src/plugins/BaseWindowPlugin.js index 7b45543e5..ff8fa8af6 100644 --- a/new-client/src/plugins/BaseWindowPlugin.js +++ b/new-client/src/plugins/BaseWindowPlugin.js @@ -278,9 +278,14 @@ class BaseWindowPlugin extends React.PureComponent { } renderControlButton() { + // Special case: if there are no plugins with target "toolbar", we want to render the Control button on small screens + const hasToolbarTarget = this.props.app.config.mapConfig.tools.filter( + (tool) => tool.options && tool.options.target === "toolbar" + ); + return createPortal( // Hide Control button on small screens, see renderDrawerButton too - + 0}>