Skip to content

Commit

Permalink
[#62] Fixed For navigation, accordion and side bar components - UP do…
Browse files Browse the repository at this point in the history
…es not close open menu/accordion.
  • Loading branch information
Joshua Fernandes committed Mar 15, 2024
1 parent 1be2ad4 commit 068fa07
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/00-base/collapsible/collapsible.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ CivicThemeCollapsible.prototype.keydownEvent = function (e) {
if (this !== document) {
// Up.
if (e.which === 38 && !e.shiftKey) {
this.dispatchEvent(new CustomEvent('ct.collapsible.collapse', { bubbles: true, detail: { animate: true } }));
this.dispatchEvent(new CustomEvent('ct.collapsible.collapse', { bubbles: true, detail: { animate: true, keydown: true } }));
return;
}

Expand Down Expand Up @@ -255,7 +255,12 @@ CivicThemeCollapsible.prototype.collapse = function (animate, evt) {
}

if (evt && evt.target) {
if (evt.currentTarget !== t.el || evt.target !== t.el) {
if(evt.detail.keydown) {
if (evt.target.closest('li') !== t.el) {
return;
}
}
else if (evt.currentTarget !== t.el || evt.target !== t.el) {
return;
}
}
Expand Down

0 comments on commit 068fa07

Please sign in to comment.