You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I discovered that alert(), prompt() and confirm() returns a promise in Tauri.
I'd love JS to make these functions a promise, but as of right now, they are sync and blocking.
The problem is that a lot of libraries rely on it for stuff like this
if(confirm("Are you sure?")){console.log("You done it!")}
In the browser:
It will wait for the user input and block the process
If the user click on Yes, it will log You done it!
If the user click on No, it won't log anything
In Tauri:
The user will be asked Are you sure?
And at the same time, it will always log You done it! (since a promise is truthful)
Describe the solution you'd like
I think the default behavior should be the same as the browser.
Another solution would be a flag or a plugin that allow those functions to be sync.
Alternatives considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the problem
I discovered that
alert()
,prompt()
andconfirm()
returns a promise in Tauri.I'd love JS to make these functions a promise, but as of right now, they are sync and blocking.
The problem is that a lot of libraries rely on it for stuff like this
In the browser:
It will wait for the user input and block the process
If the user click on Yes, it will log
You done it!
If the user click on No, it won't log anything
In Tauri:
The user will be asked
Are you sure?
And at the same time, it will always log
You done it!
(since a promise is truthful)Describe the solution you'd like
I think the default behavior should be the same as the browser.
Another solution would be a flag or a plugin that allow those functions to be sync.
Alternatives considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: