@factoringplus/pl-components-pack-v3 0.4.42-pre-9 → 0.4.42-pre-10

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.
@@ -24634,9 +24634,23 @@ const _sfc_main$y = {
24634
24634
  let newLength = e2.target.value.length;
24635
24635
  if (keyCode === 46)
24636
24636
  newLength += 1;
24637
- let cursorShift = selectionStart + (newLength - memoryLength);
24638
- if (cursorShift < 0)
24639
- cursorShift = 0;
24637
+ let cursorShift;
24638
+ if (selectionStart === selectionEnd || selectionStart + 1 === selectionEnd) {
24639
+ cursorShift = selectionStart + (newLength - memoryLength);
24640
+ if (keyCode === 8) {
24641
+ if (newLength === memoryLength) {
24642
+ cursorShift -= 1;
24643
+ } else if (selectionEnd !== selectionStart) {
24644
+ cursorShift += 1;
24645
+ }
24646
+ }
24647
+ if (cursorShift < 0)
24648
+ cursorShift = 0;
24649
+ if (selectionEnd === selectionStart && selectionEnd === cursorShift && newLength === memoryLength && keyCode !== 8 && keyCode !== 46)
24650
+ cursorShift += 1;
24651
+ } else {
24652
+ cursorShift = selectionEnd - memoryLength + newLength;
24653
+ }
24640
24654
  e2.target.selectionStart = cursorShift;
24641
24655
  e2.target.selectionEnd = cursorShift;
24642
24656
  });