Comments (9)
Doesn't work I'm afraid ):
from vue-in-viewport-mixin.
This has been released now: https://github.com/BKWLD/vue-in-viewport-mixin/releases/tag/v2.0.0
from vue-in-viewport-mixin.
Could you describe more what you mean by "moving in the dom"? Like touching CSS top
/ left
with JS?
from vue-in-viewport-mixin.
Sure, sorry. I am using this for an auto scroller. When the element is in view, more content will be loaded. However, when that content is added to the dom, causing the autoscroller element to be pushed outside the viewport, inViewport.now will remain true until the user scrolls.
from vue-in-viewport-mixin.
What happens if you call updateInViewport()
on the component you've mixed the package into AFTER the additional content has loaded? Does that update the state? If it doesn't, the next problem to solve is how to get scrollMonitor (a package this one consumes) to update it's measurements.
Perhaps you could call (if my first suggestion doesn't work):
this.scrollMonitor.recalculateLocation()
this.updateInViewport()
from vue-in-viewport-mixin.
The same problem.
- component loaded in viewport; inViewport.now === true
- another component loads big image and component now not in viewport; Still inVieport.now === true
inViewport.now properly recalculted if I do some scroll
this.scrollMonitor.recalculateLocation()
this.updateInViewport()
doesn't work
from vue-in-viewport-mixin.
I'm having the same issue.
I've got a grid with lots of products, so i'm loading only images of products in viewport (or almost). if i change the product order via button and javascript, it appears that the products now in viewport don't know their new state. at least not until the user scrolls again.
also i dont want to call a function for updating the inViewport everywhere i change the dom via javascript, the component should handle this by itself!
from vue-in-viewport-mixin.
Yeah, ScrollMonitor doesn't have an API method to fully recaculate itself ... like I haven't had a lot of success with it's recalculateLocation()
method. However, I have done this on some projects to get it to recaculate:
window.dispatchEvent(new CustomEvent('resize'))
Essentially, I fake a resize event and this forces ScrollMonitor to reassess itself.
from vue-in-viewport-mixin.
I'll soon be releasing a breaking 2.0 version of this package that uses the IntersectionObserver and will fix issues like this since it's not scroll based. It's is on master
right now: https://github.com/BKWLD/vue-in-viewport-mixin
from vue-in-viewport-mixin.
Related Issues (20)
- Error in IE11? HOT 1
- It doesn't work for horizontal scroll div HOT 1
- Binding to a different container HOT 6
- Before scroll element not detected in viewport HOT 5
- 2.x: Issue with elements that are taller than viewport and fully in viewport detection in IE11 HOT 1
- Issues detecting above, below, and fully when scrolling fast past a 100vh item
- 2.0.0 - images never loading HOT 2
- Refactor so that multiple calls to getBoundingClientRect() don't get made HOT 1
- display: none causing errors HOT 6
- IntersectionObserver constructor error while using globally HOT 1
- Add hooks for activated / deactivated HOT 2
- IntersectionObserver constructor error: Infinity in threshold array HOT 3
- Make the `once` property un-listen if initially visible HOT 1
- Refactor to pass in configuration via a factory function
- See about fixing off by one issue in scrollMonitor HOT 1
- Vue 3 compatibility HOT 3
- npm module does not include compiled files HOT 3
- Binding to child elements of the component HOT 2
- In viewport element of the component HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-in-viewport-mixin.