How do I prevent window focus change when Meteor reactive template update from data subscription changes?

StackOverflow https://stackoverflow.com//questions/10681918

  •  12-12-2019
  •  | 
  •  

Question

I have a long page. It contains references to templates, some of which render data.

One of the templates on the page is subscribed to a collection. When the collection changes the view in that template renders those items that have been added or changed. It does so quite nicely and doesn't reload the page.

The problem is that the focus of the page jumps to that template when data renders. The data the template renders is being updated by other users and the server. So, the user might not be viewing that part of the page when it renders incoming data and changes.

If the user is reading data further down the page when this template renders data the screen focus jumps back up to the reactive template area of the page where the data rendered. It is very annoying.

How to I prevent screen focus from jumping to the area that renders data on a long page?

Was it helpful?

Solution

Meteor doesn't support the "autofocus" attribute at the moment. If you want to focus something on page load, you have to do it explicitly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top