@syncfusion/ej2-calendars 31.2.15 → 31.2.16

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.
@@ -15570,6 +15570,9 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
15570
15570
  };
15571
15571
  MaskedDateTime.prototype.maskInputHandler = function () {
15572
15572
  var start = this.parent.inputElement.selectionStart;
15573
+ if (Browser.isDevice && (Browser.isIos || Browser.isIos7)) {
15574
+ start = this.normalizeTokenIndex(start);
15575
+ }
15573
15576
  var formatText = '';
15574
15577
  if (this.validCharacters.indexOf(this.hiddenMask[start]) !== -1) {
15575
15578
  formatText = this.hiddenMask[start];
@@ -15589,10 +15592,18 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
15589
15592
  break;
15590
15593
  }
15591
15594
  }
15592
- var scrollPositionY;
15595
+ var scrollContext = null;
15596
+ var savedScrollTop = 0;
15593
15597
  if (Browser.isDevice && (Browser.isIos || Browser.isIos7)) {
15594
15598
  var scrollableParent = this.findScrollableParent(this.parent.inputElement);
15595
- scrollPositionY = scrollableParent ? scrollableParent.getBoundingClientRect().top : window.scrollY;
15599
+ if (scrollableParent) {
15600
+ scrollContext = scrollableParent;
15601
+ savedScrollTop = scrollableParent.scrollTop;
15602
+ }
15603
+ else {
15604
+ scrollContext = window;
15605
+ savedScrollTop = window.pageYOffset || document.documentElement.scrollTop || 0;
15606
+ }
15596
15607
  }
15597
15608
  this.parent.inputElement.selectionStart = start;
15598
15609
  this.validCharacterCheck();
@@ -15602,7 +15613,12 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
15602
15613
  this.navigateSelection(isbackward);
15603
15614
  if (Browser.isDevice && (Browser.isIos || Browser.isIos7)) {
15604
15615
  setTimeout(function () {
15605
- window.scrollTo(0, scrollPositionY);
15616
+ if (scrollContext) {
15617
+ scrollContext.scrollTop = savedScrollTop;
15618
+ }
15619
+ else {
15620
+ window.scrollTo(0, savedScrollTop);
15621
+ }
15606
15622
  }, 0);
15607
15623
  }
15608
15624
  }
@@ -15797,6 +15813,35 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
15797
15813
  this.dayTypeCount = 0;
15798
15814
  this.monthTypeCount = 0;
15799
15815
  };
15816
+ MaskedDateTime.prototype.isMaskToken = function (i) {
15817
+ return i >= 0 && i < this.hiddenMask.length &&
15818
+ this.validCharacters.indexOf(this.hiddenMask[i]) !== -1;
15819
+ };
15820
+ MaskedDateTime.prototype.normalizeTokenIndex = function (index, preferPrev) {
15821
+ if (preferPrev === void 0) { preferPrev = false; }
15822
+ if (this.isMaskToken(index)) {
15823
+ return index;
15824
+ }
15825
+ var prev = index - 1;
15826
+ var next = index + 1;
15827
+ if (preferPrev) {
15828
+ if (this.isMaskToken(prev)) {
15829
+ return prev;
15830
+ }
15831
+ if (this.isMaskToken(next)) {
15832
+ return next;
15833
+ }
15834
+ }
15835
+ else {
15836
+ if (this.isMaskToken(next)) {
15837
+ return next;
15838
+ }
15839
+ if (this.isMaskToken(prev)) {
15840
+ return prev;
15841
+ }
15842
+ }
15843
+ return index;
15844
+ };
15800
15845
  MaskedDateTime.prototype.destroy = function () {
15801
15846
  this.removeEventListener();
15802
15847
  };