@annalib/anna-core 20.0.8 → 20.0.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.
@@ -5324,9 +5324,12 @@ class DigitOnlyDirective {
5324
5324
  return this.inputElement.value.substring(this.inputElement.selectionStart ?? 0, this.inputElement.selectionEnd ?? 0);
5325
5325
  }
5326
5326
  forecastValue(key) {
5327
- const selectionStart = this.inputElement.selectionStart ?? 0;
5328
- const selectionEnd = this.inputElement.selectionEnd ?? 0;
5327
+ const selectionStart = this.inputElement.selectionStart;
5328
+ const selectionEnd = this.inputElement.selectionEnd;
5329
5329
  const oldValue = this.inputElement.value;
5330
+ if (selectionStart == null && selectionEnd == null) {
5331
+ return (oldValue + key);
5332
+ }
5330
5333
  return (oldValue.substring(0, selectionStart) +
5331
5334
  key +
5332
5335
  oldValue.substring(selectionEnd));