Comments (4)
@joshwnj cool.
Certainly, we consider visibility: hidden
as well.
Will file a PR later :)
from react-visibility-sensor.
Has there been any updates on this?
from react-visibility-sensor.
@tywong good idea.
Without benchmarking we won't know for sure, but I'm guessing that checking for display: none
is cheaper than checking the element's position in relation to the viewport. Somebody might like to run some tests to confirm, but in the meantime we can short-circuit the check
method, like:
if (elStyle.display === 'none') { return false; }
// otherwise, continue with comparing element's position to viewport
...
It would probably also make sense to check for visibility: hidden
style as well, right?
from react-visibility-sensor.
Hi @tywong and @cc-shen, could you please confirm whether this issue is resolved now that #114 is merged? Thanks!
from react-visibility-sensor.
Related Issues (20)
- Link Anchor Not Working
- trigger when it reaches a certain section of the viewport/containment HOT 1
- How to keep elements visible after first scroll HOT 4
- Use requestAnimationFrame
- Containment as a RefObject HOT 2
- onChange is not triggered when required component reaches viewport HOT 2
- No Init check for visibility ?
- No handler for determining visibility of elements that never change visibility
- Deprecation Error with React.StrictMode HOT 5
- Is this project dead? HOT 6
- Error when dispatching on load
- Visibility sensor is not capturing when the first element's top section is in view
- Calling onChange in one element when another element goes out of view
- Is project abandoned? HOT 1
- You should update the readme:
- does not match the corresponding path on disk `react`.
- VisibilitySensor doesn't fire on smaller devices
- Warning: findDOMNode is deprecated in StrictMode HOT 4
- Cannot read properties of undefined (reading 'Component')
- TS2694: Namespace 'React' has no exported member 'StatelessComponent'
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 react-visibility-sensor.