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 x show transition overlap #543

Merged

Conversation

MuzafferDede
Copy link
Contributor

@MuzafferDede MuzafferDede commented Jun 2, 2020

Fixes #533 (tested) | #170 (tested, need more test) | #156 (partly tested, need more test) | you tell me

I have to refactor transition to achieve this solution. So there is a #542 Refactored Transition PR of this PR which has same solution + refactored transitions to let transitions has its own space so it will be easier to work on it. (it was really hard to work on existing transition code). I have explained much more on #542 since they serve almost same purpose.

This fix is quite self explanatory. I assigned few variables to check transitions and make sure and control how they are rendered.

By this, quick clicks overlapping transitions and wrong state of display issues will be fixed. There is also a test called remaining transitions forced to complete if they exists which tests this bug.

Let me know if there is any room to improve. Huge thanks @SimoTod and @HugoDF for their comments. .5 x more thanks to @SimoTod for bearing with me :).

Copy link
Collaborator

@SimoTod SimoTod left a comment

Choose a reason for hiding this comment

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

Thanks, I'd like to decrease the number of variable we set on el (I'm not sold on the timeout variable).
There is a point I don't understand, i'd like to know what we mean with If previous transitions still there, don't use resolve couple of other minor comments as well. Some of them could apply to the other PR as well (I haven't checked).

As a separate note, I strongly advise that we write a failing test first to prove that the PR fixes an existing bug (I'm sure it does but we don't have a regression test since everything passes in master).

src/directives/show.js Outdated Show resolved Hide resolved
src/utils.js Outdated Show resolved Hide resolved
src/utils.js Outdated Show resolved Hide resolved
src/directives/show.js Outdated Show resolved Hide resolved
test/transition.spec.js Show resolved Hide resolved
@MuzafferDede
Copy link
Contributor Author

MuzafferDede commented Jun 4, 2020

Fixed by assigning el.__x_transition_last_value at initial.

@calebporzio calebporzio merged commit ae8e34b into alpinejs:master Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Might be an Alpine Performance bug on x-show with transition
3 participants