mediacube-ui 0.1.30 → 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -545,16 +545,13 @@ export default {
|
|
|
545
545
|
case 'amount_format':
|
|
546
546
|
value = this.setDecimalsLimit(value)
|
|
547
547
|
const cursor_position = this.getCaretPos(e.target)?.start
|
|
548
|
-
|
|
549
548
|
const prepared_value = this.formattedToNumber(value)
|
|
550
|
-
value = prepared_value ? parseFloat(prepared_value) : null
|
|
551
|
-
e.target.value = this.isRtl ? value : this.getAmountFormat(prepared_value)
|
|
552
549
|
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
550
|
+
value = prepared_value ? parseFloat(prepared_value) : null
|
|
551
|
+
const formatted_value = this.getAmountFormat(prepared_value)
|
|
552
|
+
e.target.value = this.isRtl ? formatted_value.replace(/ /gm, '') : formatted_value
|
|
553
|
+
const space_length = e.target.value?.slice(0, cursor_position).replace(/[^ ]/gm, '')?.length || 0
|
|
554
|
+
this.setCaretPos(e.target, cursor_position + space_length, cursor_position + space_length)
|
|
558
555
|
break
|
|
559
556
|
}
|
|
560
557
|
|