Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for inputmode attribute #148

Open
mediafreakch opened this issue Oct 11, 2021 · 0 comments
Open

Support for inputmode attribute #148

mediafreakch opened this issue Oct 11, 2021 · 0 comments

Comments

@mediafreakch
Copy link

When using :manual-input="true" property on vue2-timepicker, a virtual keyboard will open on touch devices. An easy way to prevent that would be to pass inputmode="none" attribute to the input itself.

Inputmode works better for this purpose than using a computed property to detect touch devices and then disable manual-input correspondingly. For the reason that nowadays you'll find devices with an external keyboard AND touch support, but you still want manual input mode for those.

This is already achieveable with vue2-timepicker today like so:

// in your component that uses vue2-timepicker
mounted() {
    // disable virtual keyboard on mobile devices
    // make sure vue2-timepicker has a ref="timepicker" attribute
    const input = this.$refs.timepicker.$refs.input

    if (input) {
      input.inputMode = 'none'
    }
},

Accepting an inputmode prop would make it smoother.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant