diff --git a/api/js/egw_action/EgwDragDropShoelaceTree.ts b/api/js/egw_action/EgwDragDropShoelaceTree.ts index 41681a3d61..f963783ec1 100644 --- a/api/js/egw_action/EgwDragDropShoelaceTree.ts +++ b/api/js/egw_action/EgwDragDropShoelaceTree.ts @@ -67,11 +67,30 @@ export class EgwDragDropShoelaceTree extends egwActionObjectInterface{ { return; } + if(this.stateChangeContext) + { + const target = this.tree.shadowRoot.querySelector("[id='" + this.stateChangeContext.id + "']"); + + // Just set the attribute, we're not changing the tree value + // The selected attribute will be reset by the tree next render() + if(target && egwBitIsSet(_state, EGW_AO_STATE_SELECTED)) + { + target.setAttribute("selected", ""); + } + else if(target) + { + target.removeAttribute("selected"); + } + if(target && egwBitIsSet(_state, EGW_AO_STATE_FOCUSED)) + { + target.focus(); + } + } // Update the "focused" flag if(egwBitIsSet(_state, EGW_AO_STATE_FOCUSED)) { - this.tree.focusItem(this.id); + this.tree.focus(); } if(egwBitIsSet(_state, EGW_AO_STATE_SELECTED)) { diff --git a/api/js/egw_action/EgwPopupActionImplementation.ts b/api/js/egw_action/EgwPopupActionImplementation.ts index 049d7e6e24..d536fee22d 100644 --- a/api/js/egw_action/EgwPopupActionImplementation.ts +++ b/api/js/egw_action/EgwPopupActionImplementation.ts @@ -314,7 +314,7 @@ export class EgwPopupActionImplementation implements EgwActionImplementation { event: e, posx: _xy.posx, posy: _xy.posy, innerText: nodeToUse?.title || _node.innerText,//nodeToUse only exists on widgets that define findActionTarget - target: nodeToUse?.target || _node, + target: nodeToUse || _node, }; _callback.call(contextToUse || _context, _implContext, this); }