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

feat(Visibility): add fireOnMount #2018

Merged
merged 2 commits into from
Sep 1, 2017
Merged

Conversation

layershifter
Copy link
Member

Fixes #1911.

@codecov-io
Copy link

codecov-io commented Aug 29, 2017

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2018      +/-   ##
==========================================
+ Coverage   99.76%   99.76%   +<.01%     
==========================================
  Files         148      148              
  Lines        2556     2557       +1     
==========================================
+ Hits         2550     2551       +1     
  Misses          6        6
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 e1ff28a...0c01b20. Read the comment docs.

@levithomason
Copy link
Member

Made a small verbiage tweak, will merge on pass.

@levithomason levithomason merged commit 578b957 into master Sep 1, 2017
@levithomason levithomason deleted the feat/visibility-fire-on-mount branch September 1, 2017 05:53
@levithomason
Copy link
Member

Released in [email protected]

layershifter added a commit that referenced this pull request Sep 11, 2017
* feat(Visibility): add fireOnMount

* docs(Visibility): remove "once" from fireOnMount
@boostup
Copy link

boostup commented Nov 16, 2017

Hello Guys!

I'm basically trying to show a react element that is onScreen on first render. So, I found Visibility: onOnScreen doesn't fire if element is onScreen on first render, which lead me to this page here.

1)According to the comment on this page on Sep 11, a fix was released at version 0.73.0
I have version 0.76.0 in my project. However, when wrapping it with a Visibility react tag, an element, say an image, does not show it until I scroll even though the image is already partially onScreen.

2)Also, if I include the fireOnMount prop on the Visibility tag, then calculations.onScreen is always equal to true. Is that normal? I can't understand the reason for this...What is fireOnMount for? I don't get it from the docs https://semantic-ui.com/behaviors/visibility or https://react.semantic-ui.com/behaviors/visibility

Here is a codesandbox: https://codesandbox.io/s/nr5k9k6zwp

Thanks for any assistance on these 2 points

@layershifter
Copy link
Member Author

layershifter commented Nov 16, 2017

If you want to get help, you should create a new issue and fully fill issue template.

@Semantic-Org Semantic-Org locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants