From 3079e963568f19ed7140db6432adfa8c7103d1be Mon Sep 17 00:00:00 2001 From: Pablo Ziliani Date: Tue, 1 Apr 2014 12:50:09 -0300 Subject: [PATCH] Softer method to make Safari refresh the object content --- index.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 08c57b0..a012713 100644 --- a/index.js +++ b/index.js @@ -442,11 +442,14 @@ el.setAttribute( "data", el.getAttribute( "data-data" )); /** - * This is necessary to make Safari (and, apparently, old versions of Chrome) - * re-render the new content; see: - * stackoverflow.com/questions/11245385/object-works-in-every-browser-except-google-chrome + * This is necessary to make Safari 7 refresh the object's new content */ - el.innerHTML = el.innerHTML; + var activeElement = document.activeElement; + el.focus(); + + if ( activeElement ) { + activeElement.focus(); + } } return el;