Skip to content

nested TemplateContainer #8

Description

@wonho-lee-movin3d

I`m working on MacOS editor 6000.0.43f1, and built-in ContextualMenuManipulator seems not working.
This repo is the only solution for now, Thanks for your work.

private VisualElement GetElementRoot(VisualElement visualElement)
{
    VisualElement result = null;
    for (; visualElement != null; visualElement = visualElement.hierarchy.parent)
    {
        if (visualElement is TemplateContainer)
        {
            result = visualElement;
            break;
        }
    }
    return result;
}

FYI
But your ContextualMenuManager finds wrong root under instances from Template, like items in ListView.
So I overrided ContextualMenuManager and passed it to ContextualMenuManipulator constructor.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions