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

LocalItemSelector data doesn't update when itemSelector prop does #30

Closed
Jakob-Maudience opened this issue Jul 26, 2019 · 3 comments
Closed
Labels
bug

Comments

@Jakob-Maudience
Copy link

@Jakob-Maudience Jakob-Maudience commented Jul 26, 2019

Description

I'm having an issue where I want to dynamically update the item selector in the component under certain conditions (I have a submenu in my context menu, and when it's open, I only want the keyboard nav to cycle through the sub menu items, which have a different class)

As you can see in the cache, the itemSelector property gets updated by the parent component, but the internal localItemSelector data remains cached, and doesn't update.

2019-07-26_11-39-36

This prevents the keyboard navigation from cycling through the elements I need under those conditions.

Steps to Reproduce

  1. In the parent component, add a computed property that is set to different classnames under different conditions. Here's my code:
contextItemSelector() {
     return this.subMenuOpen ? '.context-option--submenu' : '.context-option';
 },
  1. Set the itemSelector property on the vue-context component to the computed property
<vue-context ref="menu" :item-selector="contextItemSelector">

Expected behavior: I expect the class selector to update

Actual behavior: The component gets the initial state, but doesn't update.

Reproduces how often: 100% of the time

Version

Package : 4.0.1
Browser: Chromium (Electron)

@rawilk

This comment has been minimized.

Copy link
Owner

@rawilk rawilk commented Jul 28, 2019

@Jakob-Maudience Thank you for reporting the issue. I have released a new version of the menu (4.0.3) that addresses this issue. If you have further issues with this, please let me know and I can look into it.

@rawilk rawilk added the bug label Jul 28, 2019
@Jakob-Maudience

This comment has been minimized.

Copy link
Author

@Jakob-Maudience Jakob-Maudience commented Jul 29, 2019

Thanks for the quick update. I'll update my package and let you know if I run into any issues.

@rawilk

This comment has been minimized.

Copy link
Owner

@rawilk rawilk commented Aug 4, 2019

Since I haven't heard anything else on this issue, I'm going to consider it closed. If you have any other issues with it, feel free to re-open this issue.

@rawilk rawilk closed this Aug 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.