Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Visibility): handle context scroll instead of just window scroll #3400

Merged

Conversation

johnkeane475
Copy link
Contributor

Currently adding a context to the Visibility component will add event listeners for that context, however the inner workings of the Visibility component still use the window scroll position for calculations.

This means that we are unable to use the Visibility component on any context other than the window.
This PR seeks to resolve this issue.

The code changes I have made are working for my use case, however I require some assistance in getting the tests to work as well as ensuring that the changes I have made are suitable for all use cases of the Visibility component.

Thanks :)

@welcome
Copy link

welcome bot commented Jan 24, 2019

💖 Thanks for opening this pull request! 💖

Here is a list of things that will help get it across the finish line:

  • Run yarn lint locally to catch formatting errors. This will fix some errors automatically, commit and push any changes.
  • Run yarn test locally to catch errors. This ensures all components still behave as they should.
  • Run yarn start to run the doc site locally and try a few pages, ensuring everything is in good working order.
  • Include tests when adding/changing behavior.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@codecov-io
Copy link

codecov-io commented Jan 24, 2019

Codecov Report

Merging #3400 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3400      +/-   ##
==========================================
+ Coverage   99.81%   99.81%   +<.01%     
==========================================
  Files         174      174              
  Lines        2725     2730       +5     
==========================================
+ Hits         2720     2725       +5     
  Misses          5        5
Impacted Files Coverage Δ
src/behaviors/Visibility/Visibility.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca81dd8...6eeee87. Read the comment docs.

// onUpdate.should.have.been.calledWithMatch(null, {
// calculations: { direction: 'down' },
// })
// })
Copy link
Member

@levithomason levithomason Mar 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this test fail? Per the PR description, I've marked this one as needing some help! 👍

@levithomason
Copy link
Member

Looking good so far! As noted, we just need some more hands on the test case.

@johnkeane475
Copy link
Contributor Author

Thanks for the feedback @levithomason
I've pushed a new commit with your suggested tidy-up.
I've also uncommented the failing test for clarity.

@layershifter layershifter merged commit 892f404 into Semantic-Org:master Apr 10, 2019
@welcome
Copy link

welcome bot commented Apr 10, 2019

Congrats on merging your first pull request! 🎉🎉🎉

robot victory dance

@johnkeane475
Copy link
Contributor Author

@layershifter Thank you very much for your help with this PR.
Is there a schedule for when the next version will be released?

@layershifter
Copy link
Member

Only Levi has release rights and he is on a vacation right now. I have asked him for a release, but I don't have any ETA 🙂

@johnkeane475
Copy link
Contributor Author

No problem, thanks :)

mbakiev pushed a commit to mbakiev/Semantic-UI-React that referenced this pull request Jun 17, 2019
…emantic-Org#3400)

* fix(Visibility): handle context scroll instead of just window scroll

* fix(Visibility): refactor and uncomment failing test

* add new test, fix broken behavior

* add note

* remove comment

* Update Visibility.js

* Update Visibility.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants