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: add Stack effect #38

Merged
merged 9 commits into from Jul 27, 2019
Merged

feat: add Stack effect #38

merged 9 commits into from Jul 27, 2019

Conversation

yaodingyd
Copy link
Contributor

@yaodingyd yaodingyd commented Jul 25, 2019

Fix #16

Screen Recording 2019-07-24 at 11 59 PM

Several major refactor/implementation details:

  1. Instead of one instances array, now there's three arrays, each for one position. instances now is an object with three arrays properties, position being the key.
  2. Adding a layer of container to hold snackbar--text and snackbar--button. This is needed for keeping the expanded status when hovering on snackbars. Previously, moving through expanded snackbars will go back to stack status because of the margin.
  3. Rename the function and event to be animation related because hide is an animation. (This is a bug somewhat related to this change.)
  4. Remove instance from array when destroyed. It should be from the beginning and it also effects the transition index if not cleared.

IssueHunt Summary

Referenced issues

This pull request has been submitted to:


IssueHunt has been backed by the following sponsors. Become a sponsor

src/index.ts Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
@egoist
Copy link
Owner

egoist commented Jul 25, 2019

截屏2019-07-25下午9 48 13

If you move your mouse over the hidden snackbars it will expand 😅

src/index.ts Outdated Show resolved Hide resolved
@yaodingyd
Copy link
Contributor Author

I don't think you last refactor (which resembles my initial tries) is correct. When we don't clear the setTimeout for setting elements hidden, if user clicks too fast and one snackbar is supposed to be visible, it's possible that last setTimeout will overwrite it's visibility and make it hidden again, like this:
Screen Recording 2019-07-26 at 09 20 AM

@egoist egoist merged commit 631a0ed into egoist:master Jul 27, 2019
@egoist
Copy link
Owner

egoist commented Jul 27, 2019

🎉 This PR is included in version 1.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Stack effect
2 participants