diff --git a/canvas_modules/common-canvas/src/toolbar/toolbar-action-item.jsx b/canvas_modules/common-canvas/src/toolbar/toolbar-action-item.jsx index 6cc0371d14..6f236be249 100644 --- a/canvas_modules/common-canvas/src/toolbar/toolbar-action-item.jsx +++ b/canvas_modules/common-canvas/src/toolbar/toolbar-action-item.jsx @@ -67,7 +67,7 @@ class ToolbarActionItem extends React.Component { // Called by toolbar.jsx isEnabled() { - return this.props.actionObj.enable; + return this.props.actionObj.enable || this.props.actionObj.jsx; } clickOutside(evt) { @@ -240,7 +240,10 @@ ToolbarActionItem.propTypes = { subMenu: PropTypes.array, subPanel: PropTypes.any, subPanelData: PropTypes.object, - jsx: PropTypes.object, + jsx: PropTypes.oneOfType([ + PropTypes.object, + PropTypes.func + ]), tooltip: PropTypes.oneOfType([ PropTypes.string, PropTypes.object, diff --git a/canvas_modules/common-canvas/src/toolbar/toolbar-button-item.jsx b/canvas_modules/common-canvas/src/toolbar/toolbar-button-item.jsx index 5bc96eceee..122aaaa0cb 100644 --- a/canvas_modules/common-canvas/src/toolbar/toolbar-button-item.jsx +++ b/canvas_modules/common-canvas/src/toolbar/toolbar-button-item.jsx @@ -54,6 +54,14 @@ class ToolbarButtonItem extends React.Component { componentDidUpdate() { if (this.props.isFocusInToolbar && this.props.buttonFocusAction === this.props.actionObj.action) { + // If a Jsx object was provided, the class of the component should have + // been set to toolbar-jsx-obj. + const jsxItem = this.buttonRef.current.querySelector(".toolbar-jsx-obj"); + if (jsxItem) { + jsxItem.focus(); + return; + } + this.buttonRef.current.focus(); } } @@ -169,7 +177,7 @@ class ToolbarButtonItem extends React.Component { return null; } - generateButton(actionObj) { + generateRegularItem(actionObj) { let labelBefore = null; let labelAfter = null; @@ -264,6 +272,26 @@ class ToolbarButtonItem extends React.Component { ); } + // Creates a