Dmx-browser and dmx-scheduler - when page data refreshes it jumps to the top of the screen

I have a page with say 12 cards on it from a database feed in a repeat region
then i have added a dmx-scheduler to refresh the data so that the page will get updated all the time.

So now i scroll to to the bottom of my page… on the site… because as this is the item i wish to view…
I update the database and the page data refreshes and all working well… and the information gets update on the page… and the page position stays “static” with the data updated :slight_smile:

NOW! when i add the dmx-browser component it creates a bit of a head ache for me :frowning:

PS! its seems to be fine in CHROME… but IE. FIREFOX it goes to the top. I have not tested on safari or opera.

Because if I scroll say down to number 12… and the database gets updated in the background via the scheduler… then the page jumps to the top of the page… but what if I have 200 items… and the page refreshes all the time… then it will jump to the top…

YES i can remove the dmx-browser component and the page will remain static in terms of position… but i need the dmx-browser component to preform other functions …

So what will be the BEST way to keep the page not moving out of position… eg make the dmx-scheduler preform its task and not move to the top of the page when dmx-browser is present.

@George @Teodor

Hi Guys… Please can you have a look at this as i had no one giving me a response in the community…

I have made a LIVE sample so that i don’t take to much of your time… I would be greatful if you have some sort of a solution for me please…

https://www.mozzi.co.za/test/index.php for the main page with a basic form to test this… please…

https://www.mozzi.co.za/test/without-dmx-browser.php

https://www.mozzi.co.za/test/with-dmx-browser.php

Thank you so much…

Does it happen also when you set the href element of the button to other than “#”?

This is just a wild guess but I believe it could be somehow related to this and how firefox implements it.

https://drafts.csswg.org/css-scroll-anchoring/

Also can you let us know what action is the scheduler running?

And why are you using such an old version of jquery? That’s a 2016 version. You should probably start by using a newer version.

Hi JonL thanks for the reply… using the jquery was just out of frustration trying anything…
I have updated it now to… jquery-3.4.1.slim.min.js

I have also removed any href or # tags… just plain text now… but still did not do the trick… but thanks for your reply and suggestions.

<div class="card-body">
<h4 class="card-title">ID {{id}} </h4>
<p class="card-text">{{title}}</p>
<p class="card-text">{{content}}</p>
<p>Number of people: {{numberof}}</p>  </div>

Can you change the scheduling to something like 5 mins? I am having a hard time trying to debug your page due to the scheduler :slight_smile:

Hi I have now made its 20 seconds… the reason why its 4 or 5 seconds is so that i have a on the fly update as the people are viewing the records… but OK i have set this to 20 seconds for you now… :slight_smile:

So how to recreate your issue on the page? Just open the page in Firfefox and wait? OR should we click something?

Have you tried using repeat children on the row and set a key instead of using repeat region?

I need more than that. I have to completely debug it in between schedule ticks as while I am debugging the data could be changed again.

5 mins would be better so I can just place a break point on the xhr call that is done by your scheduler.

Hi @Teodor … i have now set the scheduler back to 5 seconds…

Make sure you have https://www.mozzi.co.za/test/with-dmx-browser.php open on a different browser window… and make sure its scrolled say all the way to the bottom of the page…

then open https://www.mozzi.co.za/test/index.php and say update id 39 and number to anythings.
So when the scheduler runs on with-dmx-browser.php it refreshes but moves you away from the placement on the screen…

Please check my suggestion

1 Like

thanks let me have a go.

ok i have loaded a 5min file for you :slight_smile:
https://www.mozzi.co.za/test/with-dmx-browser-5min.php
Thank you…

Teodor made a suggestion below… so ill keep you posted… thanks in advance

1 Like

@Teodor … you are a SUPER STAR! thanks so much… it does my head in if i sit for hours and hours… and you come up with such a simple solution… comes with experience i guess… thank you for sharing your knowledge and support… its much appreciated! :slight_smile:

1 Like

Hi @JonL

Thanks for your help… its seems @Teodor the magician has done it again…

On the main row.
<div class="row" id="repeatnumberofpeople" is="dmx-repeat" dmx-bind:repeat="data_view1.data" key="id">

1 Like