Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

[Menu]: Hoist To Body property isn't reactive #335

@kfirba

Description

@kfirba

Describe the bug
When we set the hoist-to-body prop to be dynamic based on some other property it only works when the value changes to true. If the initial value is false and then we change the value to true we do get the desired behavior and the menu is being hoisted to the body.

However, when the value is true and we change it to false, the menu does not get "de-hoisted" back to where it initially was in the DOM. This might not be possible with the way MDC web works but according to their docs there is setIsHoisted() method which accepts a boolean and leads me to believe that a menu can be de-hoisted.

To Reproduce
Steps to reproduce the behavior:

  1. create a menu with hoisted-to-body prop bounded to a reactive data hoistMenu: false
  2. Change hoistMenu to true, the menu should be hoisted now.
  3. Change hoistMenu back to false and the menu is not being de-hoisted

Expected behavior
What I expect to happen is that the menu will be re-rendered in its proper spot in the DOM.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions