Skip to content

Commit 591eff0

Browse files
committed
fix: add missing clickout listener to overlaid on desktop
1 parent aaf43cc commit 591eff0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

js/src/sidebar.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,20 @@ class Sidebar {
131131
})
132132
} else if (breakpoint) {
133133
this._addClassName(this._getBreakpointClassName(breakpoint))
134+
135+
if (this._isOverlaid()) {
136+
EventHandler.one(this._element, TRANSITION_END, () => {
137+
this._addClickOutListener()
138+
})
139+
}
134140
} else {
135141
this._addClassName(this._firstBreakpointClassName())
142+
143+
if (this._isOverlaid()) {
144+
EventHandler.one(this._element, TRANSITION_END, () => {
145+
this._addClickOutListener()
146+
})
147+
}
136148
}
137149

138150
const complete = () => {
@@ -154,8 +166,14 @@ class Sidebar {
154166
this._removeClickOutListener()
155167
} else if (breakpoint) {
156168
this._element.classList.remove(this._getBreakpointClassName(breakpoint))
169+
if (this._isOverlaid()) {
170+
this._removeClickOutListener()
171+
}
157172
} else {
158173
this._element.classList.remove(this._firstBreakpointClassName())
174+
if (this._isOverlaid()) {
175+
this._removeClickOutListener()
176+
}
159177
}
160178

161179
const complete = () => {

0 commit comments

Comments
 (0)