Skip to content

Commit eda19c8

Browse files
authored
fix infowindow Cannot scroll when customizing (#2203)
* fix infowindow Cannot scroll when customizing * fix lint
1 parent 1a7712c commit eda19c8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/ui/InfoWindow.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ class InfoWindow extends UIComponent {
144144
const isFunc = isFunction(this.options['content']);
145145
const isStr = isString(this.options['content']);
146146
if (this.options['custom']) {
147+
const oldDom = this.getDOM();
148+
let newDom;
149+
this._bindDomEvents(oldDom, 'off');
147150
if (isStr || isFunc) {
148151
const dom = createEl('div');
149152
if (isStr) {
@@ -153,11 +156,13 @@ class InfoWindow extends UIComponent {
153156
//dymatic render dom content
154157
this.options['content'].bind(this)(dom);
155158
}
156-
return dom;
159+
newDom = dom;
157160
} else {
158161
this._replaceTemplate(this.options['content']);
159-
return this.options['content'];
162+
newDom = this.options['content'];
160163
}
164+
this._bindDomEvents(newDom, 'on');
165+
return newDom;
161166
}
162167
this._bindDomEvents(this.getDOM(), 'off');
163168
const dom = createEl('div');

0 commit comments

Comments
 (0)