何时真正需要模式对话框? [英] When are modal dialogs truly necessary?

查看:99
本文介绍了何时真正需要模式对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

模态对话框是邪恶的,但我一直读着应该尽可能删除模态对话框 "

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.

  • 确定要删除吗?"取消删除
  • 您确定要退出吗?"你为什么要问这个?你这么自负吗?

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

Why do we ever need modal dialogs?

编辑

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

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.

编辑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.

推荐答案

模态对话框的用例

  • 阻止应用程序流程,直到输入需要继续的信息为止,例如登录过程中的密码.
  • 在集中对话框中收集应用程序配置选项.在这种情况下,通常在关闭对话框时应用更改,并在进行编辑时禁用对应用程序的访问.
  • 警告当前动作的影响不可逆转.这是模态对话框的一种频繁交互模式,但可用性专家也批评它对它的预期用途(防止破坏性操作中的错误)无效,并且存在更好的替代方法.
  • 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.
    • (来源:维基百科)

      在绝对禁止他们执行愚蠢行为的情况下.我公司有一个Web应用程序,用户有时会在完成工作之前离开页面.如果他们还没有保存工作,我们会用Modal(标准onbeforeunload JavaScript函数)提示他们.

      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.

      否则,如果可以帮忙,我就不会使用Modals,当应用程序从我的工作中夺走焦点时,我会讨厌它.

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

      编辑:当他们离开页面时,我们不会自动为他们保存工作.我们在其他时间执行操作,但不在他们离开页面时执行,因此不在Modal中执行.我确实写了可以在他们离开页面时保存并保存他们的工作的容器,但是实现它并不是一个伟大"的主意,特别是如果他们不小心删除了他们的工作并且不希望它自动保存的话.

      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.

      这篇关于何时真正需要模式对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆