vue-currency-input icon indicating copy to clipboard operation
vue-currency-input copied to clipboard

`hideGroupingSeparatorOnFocus` prop causing cursor to jump to end of input when using quasar

Open Dylancyclone opened this issue 1 year ago • 0 comments

Vue Currency Input version

3.0.0

Vue version

3.2.31

What browser are you using?

Chrome

What operating system are you using?

Windows

Reproduction link

Quasar: https://codesandbox.io/s/using-vue-currency-input-with-quasar-veevalidate-forked-3hv067?file=/src/App.vue:106-143 and Raw HTML: https://codesandbox.io/s/vue-currency-input-vue-3-example-forked-8d8lii?file=/src/App.vue:79-116

Describe your issue

When setting the hideGroupingSeparatorOnFocus prop to false with a Quasar input as shown in the examples, the cursor will jump to the end of the input box any time a grouping separator (a comma) is added or removed from the currency number.

The expected behavior is seen in the link below. This is the simple HTML example from the examples page with the hideGroupingSeparatorOnFocus prop set to false. https://codesandbox.io/s/vue-currency-input-vue-3-example-forked-8d8lii?file=/src/App.vue:79-116 You should be able to type at the beginning of the number and continue typing at the same place when the comma appears. gif of expected behavior

The actual behavior is seen in the link below. This is the Quasar example from the examples page with the only change being to hideGroupingSeparatorOnFocus prop set to false. https://codesandbox.io/s/using-vue-currency-input-with-quasar-veevalidate-forked-3hv067?file=/src/App.vue:106-143 Unlike the previous example, when you type in the field, the cursor jumps to the end of the input as soon as a comma appears/disappears gif of unexpected behavior

As a side note, I'm not sure if this is part of the same issue or if it should be a separate issue, the same "cursor jumping" happens when typing directly after the decimal point with or without the hideGroupingSeparatorOnFocus being set: chrome_mXkJ1Cap2F

Dylancyclone avatar Aug 17 '22 22:08 Dylancyclone