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

Menu with animation breaks position #1347

Closed
rettimo opened this issue Jul 14, 2024 · 4 comments · Fixed by #1353
Closed

Menu with animation breaks position #1347

rettimo opened this issue Jul 14, 2024 · 4 comments · Fixed by #1353
Labels
bug Something isn't working enhancement New feature or request

Comments

@rettimo
Copy link

rettimo commented Jul 14, 2024

React/React-dom version: 18.3.1
React-Menu version: 4.1.0

Describe the bug

I used the tailwind example as a basis for my menu and styling. It was later noticed that due to the scale animation, I was getting the wrong menu position after fully opening.

Example 1:

keyframes: {
   fadeIn: { from: { opacity: 0, transform: "scale(.95)" } },
   fadeOut: { to: { opacity: 0, transform: "scale(.95)" } },
},
image

Example 2:

keyframes: {
   fadeIn: { from: { opacity: 0, transform: "scale(.5)" } },
   fadeOut: { to: { opacity: 0, transform: "scale(.5)" } },
},
image

To Reproduce

  1. Use tailwind example as a basis.
  2. Set align="center" to the Menu component.
  3. Change the scale to any value, or leave the original.
  4. Watch the menu shuffle when using this animation.

Expected behavior

The use of animations should not affect the menu position

@rettimo rettimo added the unconfirmed Needs triage label Jul 14, 2024
@szhsin
Copy link
Owner

szhsin commented Jul 16, 2024

Hi @rettimo , thanks for raising the issue. I will be looking into a possible fix of it.

@rettimo
Copy link
Author

rettimo commented Jul 22, 2024

Any updates about this?

@szhsin
Copy link
Owner

szhsin commented Jul 22, 2024

Have done the fix in this branch https://github.com/szhsin/react-menu/compare/feat/normalize-scale?expand=1#diff-a80d3ba2a1d3e27acec4cecbafc291463c08ea56008ca6f73c9bdf9c6de4784f

I'm adding some scale-based animation examples and updating docs. A new version should be expected tomorrow.

@szhsin szhsin added bug Something isn't working and removed unconfirmed Needs triage labels Jul 23, 2024
@szhsin szhsin linked a pull request Jul 23, 2024 that will close this issue
@szhsin
Copy link
Owner

szhsin commented Jul 23, 2024

Issue fixed by v4.2.0.

This release also added a zooming animation css file which is used by default on the docs website: https://szhsin.github.io/react-menu/

@szhsin szhsin closed this as completed Jul 23, 2024
@szhsin szhsin added the enhancement New feature or request label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants