Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

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

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

Comments

@Jakob-Maudience
Copy link

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
Copy link
Owner

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
Copy link
Author

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

@rawilk
Copy link
Owner

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 as completed Aug 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants