close property actions menu from item
This commit is contained in:
@@ -62,6 +62,11 @@ export class UmbNodePropertyActions extends UmbContextConsumerMixin(LitElement)
|
||||
this._open = !this._open;
|
||||
}
|
||||
|
||||
private _handleClose (event: CustomEvent) {
|
||||
this._open = false;
|
||||
event.stopPropagation();
|
||||
};
|
||||
|
||||
disconnectedCallback () {
|
||||
super.disconnectedCallback();
|
||||
this._subscription?.unsubscribe();
|
||||
@@ -73,7 +78,7 @@ export class UmbNodePropertyActions extends UmbContextConsumerMixin(LitElement)
|
||||
<uui-popover
|
||||
.open=${this._open}
|
||||
placement="bottom-start"
|
||||
@close="${() => this._open = false}">
|
||||
@close="${this._handleClose}">
|
||||
<uui-button
|
||||
slot="trigger"
|
||||
look="secondary"
|
||||
|
||||
@@ -30,6 +30,8 @@ export default class UmbPropertyActionClear extends UmbContextConsumerMixin(LitE
|
||||
|
||||
private _handleLabelClick () {
|
||||
this._notificationService?.peek('Clear value');
|
||||
// TODO: how do we want to close the menu? Testing an event based approach
|
||||
this.dispatchEvent(new CustomEvent('close', { bubbles: true, composed: true }));
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
@@ -30,6 +30,8 @@ export default class UmbPropertyActionCopy extends UmbContextConsumerMixin(LitEl
|
||||
|
||||
private _handleLabelClick () {
|
||||
this._notificationService?.peek('Copied to clipboard');
|
||||
// TODO: how do we want to close the menu? Testing an event based approach
|
||||
this.dispatchEvent(new CustomEvent('close', { bubbles: true, composed: true }));
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
Reference in New Issue
Block a user