From 5ff5d8b5eee84a26733ea6ed2a4339d8d7e0c2ef Mon Sep 17 00:00:00 2001 From: CTomlyn Date: Tue, 24 Sep 2024 04:33:12 -0700 Subject: [PATCH] #2172 Make automatic focus on CommonCanvas opt-out (#2174) Signed-off-by: CTomlyn --- .../common-canvas/src/common-canvas/cc-contents.jsx | 5 ++++- .../common-canvas/src/object-model/config-utils.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/canvas_modules/common-canvas/src/common-canvas/cc-contents.jsx b/canvas_modules/common-canvas/src/common-canvas/cc-contents.jsx index 3147c5763e..599fa2ccdf 100644 --- a/canvas_modules/common-canvas/src/common-canvas/cc-contents.jsx +++ b/canvas_modules/common-canvas/src/common-canvas/cc-contents.jsx @@ -123,7 +123,10 @@ class CanvasContents extends React.Component { if (this.props.canvasConfig.enableBrowserEditMenu) { this.addEventListeners(); } - this.focusOnCanvas(); + + if (this.props.canvasConfig.enableFocusOnMount) { + this.focusOnCanvas(); + } } componentDidUpdate(prevProps) { diff --git a/canvas_modules/common-canvas/src/object-model/config-utils.js b/canvas_modules/common-canvas/src/object-model/config-utils.js index bbb277840d..87ec8e0ab8 100644 --- a/canvas_modules/common-canvas/src/object-model/config-utils.js +++ b/canvas_modules/common-canvas/src/object-model/config-utils.js @@ -99,6 +99,7 @@ export default class ConfigUtils { enableSingleOutputPortDisplay: false, enableNarrowPalette: true, schemaValidation: false, + enableFocusOnMount: true, enableBoundingRectangles: false, // Not documented enableCanvasUnderlay: "None", // Not documented enableParentClass: "", // Not documented