Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit d130a25

Browse files
committed
fix: container ref
1 parent 0b10f59 commit d130a25

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Dropdown/Dropdown.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,18 @@ class Dropdown extends Util.mixin(BindMixin) {
135135
}
136136

137137
addScrollListener() {
138-
this.container.addEventListener("scroll", this.closeDropdown);
138+
if (this.container && this.container.current) {
139+
this.container.current.addEventListener("scroll", this.closeDropdown);
140+
}
139141
}
140142

141143
removeKeydownListener() {
142144
global.document.body.removeEventListener("keydown", this.handleKeyDown);
143145
}
144146

145147
removeScrollListener() {
146-
if (this.container) {
147-
this.container.removeEventListener("scroll", this.closeDropdown);
148+
if (this.container && this.container.current) {
149+
this.container.current.removeEventListener("scroll", this.closeDropdown);
148150
}
149151
}
150152

0 commit comments

Comments
 (0)