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

Does not select all when given focus #92

Closed
whit0489 opened this issue Apr 16, 2020 · 1 comment
Closed

Does not select all when given focus #92

whit0489 opened this issue Apr 16, 2020 · 1 comment

Comments

@whit0489
Copy link

If you are reporting bugs please fill the form below otherwise feel free to delete the form.

Expected Behavior

When tabbed or mouse clicked into. All of the text is selected

Actual Behavior

None of the text is selected

Steps to Reproduce the Problem

  1. Can be seen directly on your demo: https://kevinongko.github.io/vue-numeric/

Specifications

N/A given it can be seen on the demo on chrome

  • Plugin Version:
  • Vue.js Version:
  • Browser:
  • OS:
@mykhailotarabtsov
Copy link

@whit0489 Hello.
I've faced the same problem (if it a problem).
So I fixed it in a next way:
Please point out for @mousedown.native and @Focus events.
How I use vue-numeric component:
<vue-numeric v-keypress-number-handle:[inputType] :value="value ? value : 0" :disabled="disable" :readonly="isReadonly" :currency="currency" :precision="precision" :thousand-separator="selectedSeparators.thousands" :decimal-separator="selectedSeparators.decimal" currency-symbol-position="suffix" @mousedown.native="isNumericClicked = true" @input="$emit('input', $event)" @blur="$emit('blur', $event); isNumericClicked = false" @focus="numericFocusHandler"> </vue-numeric>

Method on focus handler:
numericFocusHandler (event) { if (!this.isNumericClicked) { // select the all input value on tab key setTimeout(() => { event.target.select() }, 50) } this.$emit('focus', event) }

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

3 participants