This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23899 - Wouldn't it be nice if it was actually modal? var result = dialog.showModal(); would be great like window.prompt() & window.confirm()
Summary: Wouldn't it be nice if it was actually modal? var result = dialog.showModal()...
Status: RESOLVED WONTFIX
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-23 11:28 UTC by contributor
Modified: 2014-03-07 23:49 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2013-11-23 11:28:59 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html
Multipage: http://www.whatwg.org/C#dom-dialog-showmodal
Complete: http://www.whatwg.org/c#dom-dialog-showmodal
Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html

Comment:
Wouldn't it be nice if it was actually modal? var result = dialog.showModal();
would be great like window.prompt() & window.confirm()

Posted from: 95.116.16.39 by Christoph142@gmx.com
User agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.6 Safari/537.36 OPR/19.0.1326.0 (Edition Developer)
Comment 1 Ian 'Hixie' Hickson 2013-11-25 18:41:38 UTC
Nice for script authors, sure. Not for anyone else, unfortunately. We're trying really hard to move away from synchronous APIs like this.
Comment 2 christoph142 2013-11-27 12:40:03 UTC
OK, understandable.
I understand that asynchronous handling is to be preferred. And I do.

But there's one scenario that I was confronted with where I didn't find a solution other than making it modal:
I tried to overwrite window.prompt() and window.confirm() with custom implementations that looked a bit more modern. But there's no way to return a value to the variable those commands are assigned to.

Any ideas?
Comment 3 Ian 'Hixie' Hickson 2014-03-07 23:49:34 UTC
Yeah, if you want a strictly backwards-compatible version of those APIs, your only option right now is to implement it using showModalDialog(), and that's probably going to go away eventually.

If you don't need to be exactly compatible, you could return a promise.