Skip to content

Commit

Permalink
js: Fixed tab selection event handling in RapidContext.Widget.TabCont…
Browse files Browse the repository at this point in the history
…ainer
  • Loading branch information
cederberg committed Nov 18, 2023
1 parent 5401a85 commit 26eafc9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/plugin/system/files/js/RapidContext_Widget_TabContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,14 @@ RapidContext.Widget.TabContainer.prototype._handleLabelClick = function (evt) {
let label = evt.delegateTarget;
let pos = label ? Array.from(label.parentNode.children).indexOf(label) : -1;
let child = this.getChildNodes()[pos];
if (child && evt.target.dataset.close) {
this.removeChildNode(child);
} else if (child) {
this.selectChild(child);
if (child) {
evt.preventDefault();
evt.stopImmediatePropagation();
if (evt.target.dataset.close) {
this.removeChildNode(child);
} else {
this.selectChild(child);
}
}
};

Expand Down

0 comments on commit 26eafc9

Please sign in to comment.