edge / wallet

The web wallet of the XE Blockchain.

Home Page:https://wallet.xe.network

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prevent auto-rerender on sorting/changing page

willgarrett64 opened this issue · comments

When using pagination to change page of a table, or changing the sorting of a table, it uses vue-router to change the query, which in turns re-renders the page.

This causes some undesired effects:

  • for a split second, the table renders as if there were no items, displaying "no stakes/transactions/etc"
    • in Stakes, this also changes the no. columns since when there are no stakes, it hides the "actions" column
  • page scrolling is returned to the top

The expected result is for the table content to update, but the overall page doesn't re-render.

@annybs - Hey Anny, one for when you're back maybe:

I've tried and tried to find a solution, but nothing seems to work. I can use window.history.pushState() to silently update the url, but the problem I had with this is that the url is updated, but not the $route object, meaning the table data isn't updated.

So many forums suggest using this.$router.replace() (instead of .push(), but this doesn't prevent re-rendering for me. From what I understand, all this does is replace the current history entry rather than adding a new one.

Anyway, I thought maybe you'd have an idea on how to resolve this, or at least work out a solution a lot quicker then me.

@annybs @willgarrett64 could you both give an update on this ticket? Thanks