什么时候真正需要模式对话框?

发布于 2024-07-09 12:34:52 字数 644 浏览 5 评论 0原文

模态对话框是邪恶的,但我一直在阅读“您应该在可能的情况下删除模态对话框”

什么时候不能删除模态对话框? 我的意思是,有哪些真正的模态任务迫使我们使用邪恶的模态对话框?

最常见的例子是“你想保存吗?” 我认为这是让用户点击“保存”而不是记住用户输入是神圣的这一概念的问题。 如果您只是自动保存并具有“撤消”或修改的功能,那么您无需询问用户是否要保存。

  • “你确定你要删除?” 取消删除
  • “您确定要退出吗?” 你为什么会问这个? 你就这么虚荣吗?

为什么我们需要模式对话框?

编辑

Web 应用程序不会计入我的书中,除非他们在浏览器中编写自己的 UI 窗口系统。 Web 应用程序没有与桌面应用程序相同的工具集。

编辑 2

我的问题与标记为重复的问题略有不同。 我觉得在任何情况下模态对话框都是最好的解决方案。 所提到的问题假设存在这种情况。

重复:模态 UI 何时可接受

Modal dialogs are evil, but I keep reading "You should remove modal dialogs when possible"

When isn't it possible to remove modal dialogs? I mean, what are some truly modal tasks that force us to use evil modal dialogs?

The most common given example is the "Do you want to Save?" I think this is the problem of the concept of having the user hit Save instead of remembering that user input is sacred. If you just saved automatically with the ability to "undo" or have revisions, then you don't ever need ask the user if they want to save.

  • "Are you sure you want to delete?" Undelete
  • "Are you sure you want to quit?" Why would you ask that? Are you that vain?

Why do we ever need modal dialogs?

EDIT

Webs app don't count in my books, unless they write their own UI windowing system within the browser. Web apps don't have the same tools set as desktop apps.

EDIT 2

My question is slightly different than the one labeled as duplicate. I feel that there is no case that modal dialogs are the best solution. The referred question assumes there is such a case.

Duplicate of: When Is Modal UI acceptable?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

末蓝 2024-07-16 12:34:52

模态对话框的用例会

  • 阻止应用程序流程,直到输入继续所需的信息,例如登录过程中的密码。
  • 在集中式对话框中收集应用程序配置选项。 在这种情况下,通常在关闭对话框时应用更改,并且在进行编辑时禁用对应用程序的访问。
  • 警告当前操作的影响是不可逆转的。 这是模式对话框的常见交互模式,但它也被可用性专家批评为对其预期用途(防止破坏性操作中的错误)无效,并且存在更好的替代方案。

(来源:Wikipedia

当我使用它们时

在绝对强制阻止他们做蠢事的情况下。 我的公司有一个网络应用程序,用户有时会在完成工作之前离开页面。 如果他们尚未保存工作,我们会使用 Modal(标准 onbeforeunload JavaScript 函数)提示他们。

否则,如果可以的话,我不会使用模态框,我讨厌应用程序从我正在做的事情中夺走焦点。

编辑:当他们离开页面时,我们不会自动保存他们的工作。 我们在其他时候这样做,但当他们离开页面时不会这样做,因此模态。 我确实写了可以在他们离开页面时进入并保存他们的工作,但实现它并不是一个“好”主意,特别是如果他们不小心删除了他们的工作并且不希望它自动保存。

Use Cases for Modal Dialogs

  • blocking the application flow until information required to continue is entered, as for example a password in a login process.
  • collecting application configuration options in a centralized dialog. In such cases, typically the changes are applied upon closing the dialog, and access to the application is disabled while the edits are being made.
  • warning that the effects of the current action are not reversible. This is a frequent interaction pattern for modal dialogs, but it is also criticised by usability experts as being ineffective for its intended use (protection against errors in destructive actions) and for which better alternatives exist.

(Source: Wikipedia)

When I use them

In instances where stopping them from doing something stupid is absolutely mandatory. My company has a web app where Users sometimes leave the page before finishing their work. We prompt them with a Modal (the standard onbeforeunload JavaScript function) if they haven't saved their work.

Otherwise, I don't use Modals if I can help it, I hate it when an app steals focus from what I'm doing.

Edit: We don't save their work automatically for them when they leave the page. We do at other times, but not when they leave the page, hence the Modal. I did write could that could go in and save their work when they left the page, but it wouldn't be a 'great' idea to implement it, especially if they accidentally deleted their work and didn't want it to automatically save.

梦境 2024-07-16 12:34:52

唯一比用户输入更神圣的是我所知道的任何文件。 除非我告诉你,否则你永远不应该修改任何涉及实现细节的文件。 因此,诸如“你想保存吗?”之类的框就出现了。 退出时是必须的,因为我可能不想保存。

The only thing more sacred than user input is any file I known about. You should never modify any file that an implementation detail unless I have told you to. Thus boxes like "do you want to save?" at exit are a must because I may want to not save.

帥小哥 2024-07-16 12:34:52

想象一个应用程序需要打开一个对话框来执行某些操作。 现在想象一下这些将是非模式对话框:当一个对话框打开时,您可以更改选择,甚至更糟 - 调用另一个命令,该命令本身会打开另一个对话框。 现在想象这些对话框是模态的:那么您必须关闭对话框才能继续 - 您无法进入对话框下选择更改或两个命令等待输入的状态。

Imagine an application which needs to open a dialog for some actions. Now imagine that these would be non-modal dialogs: while one dialog is open, you could change the selection or even worse - invoke a different command which itself opens another dialog. Now imagine the these dialogs would be modal: then you would have to close the dialog to proceed - you can't get in the state where the selection changes under a dialog or where two commands are waiting for input.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文