Skip to content

Commit

Permalink
fix(ui5-li): remove active state onmouseup (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilhan007 committed Jun 10, 2019
1 parent 0f3b8e4 commit a07880d
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions packages/main/src/ListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,26 @@ class ListItem extends ListItemBase {
return [styles, ListItemBase.styles];
}

constructor() {
super();

this.deactivate = () => {
if (this._active) {
this._active = false;
}
};
}

onBeforeRendering() {}

onEnterDOM() {
document.addEventListener("mouseup", this.deactivate);
}

onExitDOM() {
document.removeEventListener("mouseup", this.deactivate);
}

onkeydown(event) {
super.onkeydown(event);

Expand Down Expand Up @@ -141,9 +159,6 @@ class ListItem extends ListItemBase {
}
}

deactivate() {
this._active = false;
}

_onDelete(event) {
this.fireEvent("_selectionRequested", { item: this, selected: event.selected });
Expand Down

0 comments on commit a07880d

Please sign in to comment.