Core: After updating a component using AJAX in Safari, the current scroll position changes
See original GitHub issueTest code;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title>Test</title>
</h:head>
<h:body>
<h:form>
<div style="height: 1000px">
<div style="height:400px"></div>
<div style="height:1800px">
<h:inputText id="name" value="#{testBean.test}"></h:inputText>
<p:selectOneMenu>
<f:selectItems value="#{testBean.values}" />
<p:ajax listener="#{testBean.test()}" update="@form" />
</p:selectOneMenu>
</div>
</div>
</h:form>
</h:body>
</html>
Issue Analytics
- State:
- Created 3 years ago
- Comments:47 (47 by maintainers)
Top Results From Across the Web
After a component is updated, on Safari and Firefox (Mac) the ...
After a component is updated, on Safari and Firefox (Mac) the page changes its scroll position · Open the app on Safari or...
Read more >Angular 5 Scroll to top on every Route click - Stack Overflow
Using viewPortScroller.scrollToPosition([0, 0] didn't always scroll to the top. Changed parameter to [0, -50] and it works every time.
Read more >jQuery and Ajax Tutorial
AJAX Interface: jQuery provides a simple Ajax interface to send asynchronous HTTP GET/POST requests and process the response. With jQuery, you can write...
Read more >Document: scroll event - Web APIs - MDN Web Docs - Mozilla
The scroll event fires when the document view has been scrolled. To detect when scrolling has completed, see the Document: scrollend event.
Read more >fancybox3 · Documentation
Get started with fancybox, probably the world's most popular lightbox script. ... Some functionality (ajax, iframes, etc) will not work when you're opening ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
IMO none of the fixes are cool currently. Merts fix duplicates DOM elements and the scripts finds both. So this doesnt work by design, wether Safari nor other browsers.
Remeber the scroll position and restore it on Safari might be the best currently but i wonder why it doesnt happen in other browsers? Maybe a jquery bug? Maybe other browsers wait to scroll until DOM elements were replaced? Does it work with plain JS replace of the DOM elements instead of jquery methods?
We must find the root problem before applying hacks.
Nice analysis Mert ✌️ We should search the Bug in selectOneMenu, not hack around in Ajax Core.