@annalib/anna-core 20.0.2 → 20.0.5

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.
@@ -5319,9 +5319,12 @@ class DigitOnlyDirective {
5319
5319
  return this.inputElement.value.substring(this.inputElement.selectionStart ?? 0, this.inputElement.selectionEnd ?? 0);
5320
5320
  }
5321
5321
  forecastValue(key) {
5322
- const selectionStart = this.inputElement.selectionStart ?? 0;
5323
- const selectionEnd = this.inputElement.selectionEnd ?? 0;
5322
+ const selectionStart = this.inputElement.selectionStart;
5323
+ const selectionEnd = this.inputElement.selectionEnd;
5324
5324
  const oldValue = this.inputElement.value;
5325
+ if (selectionStart == null && selectionEnd == null) {
5326
+ return (oldValue + key);
5327
+ }
5325
5328
  return (oldValue.substring(0, selectionStart) +
5326
5329
  key +
5327
5330
  oldValue.substring(selectionEnd));