From 157ce1b6e3cede92cc743d537701896a024281df Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 6 Nov 2015 15:04:03 +0100 Subject: [PATCH] [FIX] web: IE Edge focus bug when delete in list In the following situation : we click on an element inside a row (not the last row) which will: -> open an alert, confirm or prompt dialog -> remove the row containing the element IE Edge would enter in a odd state where the focus is not given back to the page, and clicking doesn't work anymore. This fix solves this by detecting this situation and then focusing on an input field which make IE Edge stop being crazy. opw-653282 jsfiddle showing the issue: http://jsfiddle.net/ts8bsLLg/4/ jsfiddle showing a solution: http://jsfiddle.net/ts8bsLLg/6/ bug report on microsoft: https://connect.microsoft.com/IE/feedbackdetail/view/1988284 note: applied in 9.0 community, 9.0 enterprise --- addons/web/static/src/js/views/list_view.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/web/static/src/js/views/list_view.js b/addons/web/static/src/js/views/list_view.js index 3a677d1c645..ae8fffbe7a4 100644 --- a/addons/web/static/src/js/views/list_view.js +++ b/addons/web/static/src/js/views/list_view.js @@ -1068,6 +1068,10 @@ ListView.List = Class.extend( /** @lends instance.web.ListView.List# */{ e.stopPropagation(); var $row = $(e.target).closest('tr'); $(self).trigger('deleted', [[self.row_id($row)]]); + // IE Edge go crazy when we use confirm dialog and remove the focused element + if(document.hasFocus && !document.hasFocus()) { + $('').appendTo('body').focus().remove(); + } }) .delegate('td.oe_list_field_cell button', 'click', function (e) { e.stopPropagation();