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

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

@Jakob-Maudience

Description

@Jakob-Maudience

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions