We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c70ffe2 + ebaf920 commit 73ffcc5Copy full SHA for 73ffcc5
jquery.pjax.js
@@ -292,10 +292,15 @@ function pjax(options) {
292
window.history.replaceState(pjax.state, container.title, container.url)
293
}
294
295
+ // Only blur the focus if the focused element is within the container.
296
+ var blurFocus = $.contains(options.container, document.activeElement)
297
+
298
// Clear out any focused controls before inserting new page contents.
- try {
- document.activeElement.blur()
- } catch (e) { }
299
+ if (blurFocus) {
300
+ try {
301
+ document.activeElement.blur()
302
+ } catch (e) { }
303
+ }
304
305
if (container.title) document.title = container.title
306
0 commit comments