GithubHelp home page GithubHelp logo

Comments (12)

danieledraganti avatar danieledraganti commented on May 22, 2024 3

Hello everyone. Is no one going to merge either of those two fixes? This bug really breaks many use cases...
Thank you.

from ember-in-viewport.

regsii avatar regsii commented on May 22, 2024

@awaer @poteto
Looks like this addon (at least in version 1.2.5) doesn't handle case when the element is not in viewport from the very beginning (when _triggerDidAccessViewport is called for the first time).
You can think of this like value of viewportEntered property is changed from false to false (since the default value of viewportEntered property is false).
But _triggerDidAccessViewport method only handles change of viewportEntered property from true to false and from false to true.

https://github.com/dockyard/ember-in-viewport/blob/1845c04c196bab104368878ab7005d24bee5128f/addon/mixins/in-viewport.js#L130

from ember-in-viewport.

laantorchaweb avatar laantorchaweb commented on May 22, 2024

same issue here, I didn't know what was happening until I tried to add smaller elements. But, I can confirm that if the element (component) it's taller than the viewport the events aren't fired.

from ember-in-viewport.

patuku-roy avatar patuku-roy commented on May 22, 2024

@poteto any updates about this? or maybe @awaer already had any enlightenment?

from ember-in-viewport.

awaer avatar awaer commented on May 22, 2024

@patuku-roy I couldn't find a workaround. The nearest alternative addon (ember-waypoints) doesn't meet my use case (and seems to be falling behind), so I opted for rolling my own solution that leans on scrollMonitor. It's not ideal, but it works for now.

from ember-in-viewport.

patuku-roy avatar patuku-roy commented on May 22, 2024

Same here, I've tried to use ember-waypoint but it seems using the same approach, I ended by splitting the ember-in-viewport implementation into many smaller part of the DOM, for example: if I have div contains image and text, then I put ember-in-viewport for image only, because in my case, the image height always shorter than viewport height, this is not ideal solution but at least working on my problem now.

Btw I will take a look scrollMonitor for the second option. Thanks anyway @awaer for your share.

from ember-in-viewport.

bekharsky avatar bekharsky commented on May 22, 2024

This is very annoying problem on narrow viewports :( When the element is wider than viewport.

from ember-in-viewport.

oligriffiths avatar oligriffiths commented on May 22, 2024

@poteto This still appears to be an issue. Elements taller or wider than the viewport do not trigger the enter/exit hooks. I notice that #62 attempts to fix the problem but hasn't been merged.

from ember-in-viewport.

poteto avatar poteto commented on May 22, 2024

@oligriffiths Could you try this in your package.json and let me know if it fixes your issue?

"ember-in-viewport": "DockYard/ember-in-viewport#0e31648"

from ember-in-viewport.

oligriffiths avatar oligriffiths commented on May 22, 2024

@poteto That sort of works, however if the element is initially loaded and partially outside of the viewport, then the enter hook isn't triggered. For example, if the element is partially shown but partially below the bottom of the viewport, the enter hook is not triggered.

from ember-in-viewport.

markmhendrickson avatar markmhendrickson commented on May 22, 2024

@poteto I've added 0e31648 to my package.json and it fixes this problem for me. I don't appear to be getting the same issue reported by @oligriffiths. It'd be great to see this branch merged into master so the dependency would be cleaner. Thanks!

from ember-in-viewport.

lifeinafolder avatar lifeinafolder commented on May 22, 2024

Any updates on this?

from ember-in-viewport.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.