From 60d314b165c34da6adbf2e34fb7bb8d09da16758 Mon Sep 17 00:00:00 2001 From: narcolepticinsomniac Date: Tue, 2 Jun 2020 02:33:07 -0400 Subject: [PATCH] Improve delete confirmation autofocus visual indication (#956) --- manage/manage.js | 2 ++ msgbox/msgbox.css | 9 +++++++++ popup/popup.css | 7 +++++++ 3 files changed, 18 insertions(+) diff --git a/manage/manage.js b/manage/manage.js index b6ccfef6..26c26c01 100644 --- a/manage/manage.js +++ b/manage/manage.js @@ -454,6 +454,8 @@ Object.assign(handleEvent, { API.deleteStyle(id); } }); + const deleteButton = $('#message-box-buttons > button'); + if (deleteButton) deleteButton.removeAttribute('data-focused-via-click'); }, external(event) { diff --git a/msgbox/msgbox.css b/msgbox/msgbox.css index 0afaa940..32e6c865 100644 --- a/msgbox/msgbox.css +++ b/msgbox/msgbox.css @@ -134,6 +134,15 @@ text-align: center; } +.danger #message-box-buttons > button:not([data-focused-via-click]):first-child:focus { + outline: red auto 1px; +} + +/* FF ignores color with 'auto' */ +.firefox .danger #message-box-buttons > button:not([data-focused-via-click]):first-child:focus { + outline: red solid 1px; +} + .non-windows #message-box-buttons { text-align: right; direction: rtl; diff --git a/popup/popup.css b/popup/popup.css index 9e0e509a..5706b877 100644 --- a/popup/popup.css +++ b/popup/popup.css @@ -341,6 +341,13 @@ a.configure[target="_blank"] .svg-icon.config { overflow: hidden; text-overflow: ellipsis; } +#confirm button[data-cmd="ok"]:not([data-focused-via-click]):focus { + outline: red auto 1px; +} +/* FF ignores color with 'auto' */ +.firefox #confirm button[data-cmd="ok"]:not([data-focused-via-click]):focus { + outline: red solid 1px; +} .menu-items-wrapper { width: 80%; max-height: 80%;