Skip to content
This repository was archived by the owner on Sep 4, 2024. It is now read-only.

Should bind to native input event rather than rely on componentUpdated #64

@tmorehouse

Description

@tmorehouse

Changing the approach to how this directive is implemented may make it work better with custom input components.

Rather than reply on the v-model (and firing input events, which may not always be the event used in a custom component), binding to the elements native input event, grabbing the current value via evt.target.value and formatting it, then setting the value via evt.target.valuemight make this directive more robust.

One can check if they are on a custom component by checking if el has the el.__vue__ property, and if so, then trigger the 'vue' input event el.__vue__.$emit('input', evt.target.value).

Adding a modifier to the direction to set which event is fired would be good as well (i.e. input or change)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions