Skip to content

[Feature Request] v-click-outside doesn't work with right-click or middle-click #11982

Description

@pxeger

Problem to solve

I want to create a custom context menu, like YouTube has on its video player for example. I have a @contextmenu handler that displays a div. I added a v-click-outside handler to close the context menu when another element is clicked. However, only a left-click works to trigger it, not right-click, middle-click, or extra buttons on the mouse. In many situations this may be desirable, but for a context menu the right-click in particular is quite important.

Proposed solution

Add another parameter to ClickOutsideBindingArgs interface to configure whether other mouse buttons should trigger the handler. Or perhaps the click event is passed to the conditional handler function which can determine whether the event should be counted.

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions