什么时候真正需要模态对话框? [英] When are modal dialogs truly necessary?

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

问题描述

模态对话框是邪恶的,但我一直在阅读你应该删除模态对话框如果可能"

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?

编辑

Webs 应用不计入我的书中,除非他们在浏览器中编写自己的 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.

推荐答案

模态对话框用例

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

    在某些情况下,阻止他们做愚蠢的事情是绝对必要的.我的公司有一个网络应用程序,用户有时会在完成工作之前离开页面.如果他们没有保存他们的工作,我们会使用 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天全站免登陆