promise return false in Modal component can't stop [button ok] loading
See original GitHub issueVersion
7.0.0-rc.1
Environment
any
Reproduction link
https://stackblitz.com/edit/angular-efvfiu?file=src/app/app.component.ts
Steps to reproduce
this.confirmModal = this.modal.confirm({
nzTitle: 'Do you Want to delete these items?',
nzContent: 'When clicked the OK button, this dialog will be closed after 1 second',
nzOnOk: () => new Promise((resolve, reject) => {
// setTimeout(Math.random() > 0.5 ? resolve : reject, 1000);
setTimeout(() => {
return false;
}, 1000);
}).catch(() => console.log('Oops errors!'))
});
What is expected?
when I return false, the [loading status] in OK button should be removed and back to normal status
What is actually happening?
always loading
Other?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
how to resolve a function only when model window return ...
In first function I want blocked model window on which it will return me a promise and on that promise I will resolve...
Read more >Implementing Modal Dialog Functions With Promise-based ...
Learn how to implement modal dialog functions with promise-based dialog results in your Angular application. See more from Wijmo today.
Read more >Modal
Let onCancel/onOk function return a promise object to delay closing the dialog. In the various types of information modal dialog, only one button...
Read more >How to Display the Progress of Promises in JavaScript
The video version of this tutorial can be found here... Our desired output will look something like this, as the tasks are in...
Read more >How to correctly use preventDefault(), stopPropagation ...
In vanilla JavaScript, returning false doesn't have any effect on the default behaviour or event propagation of the element, as we can see...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

resolve(false)用一個state控制visible 用promise控制按鈕狀態