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

[Bug Report][2.6.4] v-menu + dynamic activator, activatorFixed prop does not reset #14922

Closed
Kasheftin opened this issue Apr 5, 2022 · 2 comments
Labels
C: VMenu VMenu good first issue A quick-win fix that would be great for new contributors T: bug Functionality that does not work as intended/expected
Milestone

Comments

@Kasheftin
Copy link

Environment

Vuetify Version: 2.6.4
Vue Version: 2.6.13
Browsers: Chrome 98.0.4758.102
OS: Linux x86_64

Steps to reproduce

  • Click on "Dropdown" button, the menu is shown under the button;
  • Click on "Toggle Menu" twice;
  • Click on "Dropdown" button, the menu is shown somewhere at the left;

Expected Behavior

It should work in a stable way. Menu should be shown under "Dropdown" button

Actual Behavior

Menu shown in a different place after reinitialization

Reproduction Link

https://codepen.io/kasheftin/pen/rNpJyzm?editors=1010

@Tofandel
Copy link
Contributor

Tofandel commented Apr 22, 2022

Why are you attaching to a ref within itself? Do you realise the logic issue?

Your ref is actually undefined until after the vMenu has mounted

https://codepen.io/Tofandel/pen/yLprVRP?editors=1010

@Kasheftin
Copy link
Author

Attach can be considered as a reference. This case there's no logic issue - when the menu is going to appear, it should search for an activator node and attach there. It does not matter in which order the nodes are mounted.

By reporting this issue I want to point out on the bug here,

if (this.attach !== false) return

If attach prop is dynamic, it's false initially, then activatorFixed variable can be set to true. If then activator becomes true, activatorFixed does not reset. On my opinion it should be like

if (this.attach !== false) {
  this.activatorFixed = false
  return 
}

This change solves the initial issue.

There's one more repro: https://codepen.io/kasheftin/pen/rNpJyzm
It's more artificial but it does not use attach inside activator.
Repro steps:

  1. click on menu, notice it appears under the button
  2. click outside to hide the menu
  3. click on toggle
  4. click on menu - it appears in some other place, but it does not matter
  5. click outside to hide the menu
  6. click on toggle to return the system to initial state
  7. click on menu - now it appear in the different place
    Peek 2022-05-23 12-48

@KaelWD KaelWD added T: bug Functionality that does not work as intended/expected good first issue A quick-win fix that would be great for new contributors C: VMenu VMenu and removed S: triage labels May 23, 2022
@KaelWD KaelWD added this to the v2.6.x milestone Sep 6, 2022
@KaelWD KaelWD closed this as completed in 464529a Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VMenu VMenu good first issue A quick-win fix that would be great for new contributors T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

No branches or pull requests

3 participants