From 2777faefbaa6146bfca0cc8a2dbfb486b2321c0a Mon Sep 17 00:00:00 2001 From: Matt Lee Date: Thu, 12 Nov 2015 15:55:58 -0800 Subject: [PATCH] Popup: Ensure all popups can be closed by esc key. --- r2/r2/public/static/js/popup.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/r2/r2/public/static/js/popup.js b/r2/r2/public/static/js/popup.js index ec57d015b..af69c558f 100644 --- a/r2/r2/public/static/js/popup.js +++ b/r2/r2/public/static/js/popup.js @@ -70,6 +70,10 @@ listener.trigger(tuple[1]); }); }); + + // ensures element is 'focusable', otherwise closing with esc key only + // works when an input inside the modal is focused. + $el.attr('tabindex', $el.attr('tabindex') || 0); }; [ -- 2.11.4.GIT