本地复现,现象是首次进入的时候弹出弹框第一次侧滑关闭键盘,第二次侧滑是返回了上一页,弹框依旧存在滑动太快CustomDialogController没有监听到返回事件导致弹框没有在当前页面销毁可以在aboutToDisappear或onPageHide回调中searchDialogController.close(),demo如下:import { TradeStockSearchDialog } from './TradeStockSearchDialog'; @Entry @Component struct DialogPage { // 搜索对话框 searchDialogController: CustomDialogController = new CustomDialogController({ builder: TradeStockSearchDialog(), alignment: DialogAlignment.Bottom, customStyle: true, }) build() { Column() { Button('弹窗') .onClick(() => { this.searchDialogController.open(); }) } .height('100%') .width('100%') } onCancel() { console.info('chen Callback when the first button is clicked') } onPageHide(): void { this.searchDialogController.close(); } }
本地复现,现象是首次进入的时候弹出弹框第一次侧滑关闭键盘,第二次侧滑是返回了上一页,弹框依旧存在
滑动太快CustomDialogController没有监听到返回事件导致弹框没有在当前页面销毁
可以在aboutToDisappear或onPageHide回调中searchDialogController.close(),demo如下: