summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorPaul Fertser <fercerpav@gmail.com>2024-04-06 11:04:14 +0300
committerGunnar Mills <gunnar@gmills.xyz>2024-04-18 19:45:03 +0300
commitd1ef18e6f9ed1527b66cec07eba6acaf9a95819c (patch)
tree2bacbe44250d86c6699ffbb70efc6aa00158f8da /docs
parentf8207740c3897532207f66da01facc41ea13c020 (diff)
downloadwebui-vue-d1ef18e6f9ed1527b66cec07eba6acaf9a95819c.tar.xz
Focus default action in modal windows
Users of common WIMP GUIs (as opposed to interfaces primarily meant for touch input) expect dialog boxes to have keyboard focus set on the button for default action so that it can be executed by a single key press. Usually that is chosen to proceed with the operation but in cases where that leads to data loss the UI designers often pre-select Cancel as a precaution. This patch adds suitable property to all invocations of msgBoxConfirm() method of `this.$bvModal` BootstrapVue object. For regular actions the confirmation button is selected and can be activated by Enter or Space bar. For actions deemed dangerous Cancel is focused instead so it takes two key presses (first being Tab to shift the focus) to prooceed. This also improves accessibility following the Web Content Accessibility Guidelines (WCAG) published by W3C. Tested: manually verified that modals are consistently shown with the specified button focused, Enter and Space bar key presses produce the same effect as left pointer button click: when Cancel is focused it just closes the window, when OK is focused it sends the corresponding request to the Redfish endpoint. Change-Id: I66bfd02e48e08dc18994b11bbdd5d6b3ea27047f Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/guide/guidelines/internationalization.md1
1 files changed, 1 insertions, 0 deletions
diff --git a/docs/guide/guidelines/internationalization.md b/docs/guide/guidelines/internationalization.md
index 7afc4598..f9ee4737 100644
--- a/docs/guide/guidelines/internationalization.md
+++ b/docs/guide/guidelines/internationalization.md
@@ -72,5 +72,6 @@ this.$bvModal
title: this.$tc('pageDumps.modal.deleteDump'),
okTitle: this.$tc('pageDumps.modal.deleteDump'),
cancelTitle: this.$t('global.action.cancel'),
+ autoFocusButton: 'ok',
})
```