diff --git a/cocos/ui/editbox/edit-box-impl.ts b/cocos/ui/editbox/edit-box-impl.ts index 8eca9ae9aa..2caea2f8d4 100644 --- a/cocos/ui/editbox/edit-box-impl.ts +++ b/cocos/ui/editbox/edit-box-impl.ts @@ -121,9 +121,12 @@ export class EditBoxImpl extends EditBoxImplBase { this._registerEventListeners(); this._addDomToGameContainer(); View.instance.on('canvas-resize', this._resize, this); + screenAdapter.on('window-resize', this._resize, this); } public clear (): void { + View.instance.off('canvas-resize', this._resize, this); + screenAdapter.off('window-resize', this._resize, this); this._removeEventListeners(); this._removeDomFromGameContainer();