@annalib/anna-core 20.0.4 → 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.
- package/esm2020/lib/anna-core-shared-lib/directives/digits-only/digits-only.directive.mjs +6 -3
- package/fesm2015/annalib-anna-core.mjs +5 -3
- package/fesm2015/annalib-anna-core.mjs.map +1 -1
- package/fesm2020/annalib-anna-core.mjs +5 -2
- package/fesm2020/annalib-anna-core.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
5323
|
-
const selectionEnd = this.inputElement.selectionEnd
|
|
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));
|