@unvired/turboforms-embed-sdk 1.0.20 → 1.0.22

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.
@@ -513,12 +513,16 @@ body {
513
513
  box-sizing: border-box;
514
514
  background-color: #f5f5f5;
515
515
  font-family: Arial, sans-serif;
516
+ overflow: hidden; /* Prevent window from scrolling */
516
517
  }
517
518
 
518
519
  .formio-wrapper {
519
520
  border: 1px solid #ccc;
520
521
  background-color: #fff;
521
522
  border-radius: 8px;
523
+ overflow-y: auto; /* Enable internal scrolling */
524
+ -webkit-overflow-scrolling: touch;
525
+ height: 100%; /* Fill space */
522
526
  }
523
527
 
524
528
  #progressContainer {
@@ -1077,6 +1081,41 @@ body {
1077
1081
  margin-right: auto;
1078
1082
 
1079
1083
  }
1084
+
1085
+ /* Prevent iOS zoom/jump on Select search input by ensuring font-size is 16px */
1086
+ .ui.form .choices[data-type*='select-one'] input.choices__input {
1087
+ font-size: 16px !important;
1088
+ }
1089
+
1090
+ /* Add buffer at bottom to allow last components to scroll above the keyboard */
1091
+ #formio-wrapper {
1092
+ padding-bottom: 800px !important;
1093
+ }
1094
+
1095
+ /* Logically add space below the select when opened to allow scrolling the last row higher */
1096
+ .choices.is-open {
1097
+ margin-bottom: 800px !important;
1098
+ overflow: visible !important;
1099
+ }
1100
+
1101
+ /* Prevent dropdown from being layered behind table headers or other rows */
1102
+ .choices__list--dropdown {
1103
+ z-index: 10000 !important;
1104
+ overflow-y: auto !important;
1105
+ -webkit-overflow-scrolling: touch;
1106
+ }
1107
+
1108
+ /* Ensure the internal list doesn't have its own scrollbar/max-height that clips items */
1109
+ .choices__list--dropdown .choices__list {
1110
+ max-height: none !important;
1111
+ overflow: visible !important;
1112
+ padding-bottom: 20px !important;
1113
+ }
1114
+
1115
+ /* Add extra space for the last item to ensure it's not clipped on iOS */
1116
+ .choices__list--dropdown .choices__item:last-child {
1117
+ padding-bottom: 20px !important;
1118
+ }
1080
1119
  }</style>
1081
1120
  <style>.r6o-drawing{cursor:none}.r6o-relations-layer.readonly .handle rect{pointer-events:none}.r6o-relations-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.r6o-relations-layer circle{stroke:#515151;stroke-width:.4;fill:#3f3f3f}.r6o-relations-layer path{stroke:#595959;stroke-linecap:round;stroke-linejoin:round;fill:transparent}.r6o-relations-layer path.connection{stroke-width:1.6;stroke-dasharray:2,3}.r6o-relations-layer path.r6o-arrow{stroke-width:1.8;fill:#7f7f7f}.r6o-relations-layer .handle rect{stroke-width:1;stroke:#595959;fill:#fff;pointer-events:auto;cursor:pointer}.r6o-relations-layer .handle text{font-size:10px}.r6o-relations-layer .hover{stroke:rgba(63,63,63,.9);stroke-width:1.4;fill:transparent}
1082
1121
  .r6o-btn{background-color:#4483c4;border:1px solid #4483c4;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-size:14px;margin:0;outline:none;text-decoration:none;white-space:nowrap;padding:6px 18px;min-width:70px;vertical-align:middle;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.r6o-btn *{vertical-align:middle;cursor:pointer}.r6o-btn .r6o-icon{margin-right:4px}.r6o-btn:disabled{border-color:#a3c2e2 !important;background-color:#a3c2e2 !important}.r6o-btn:hover{background-color:#4f92d7;border-color:#4f92d7}.r6o-btn.outline{border:1px solid #4483c4;color:#4483c4;background-color:transparent;text-shadow:none}.r6o-autocomplete{display:inline;position:relative}.r6o-autocomplete div[role=combobox]{display:inline}.r6o-autocomplete input{outline:none;border:none;width:80px;height:100%;line-height:14px;white-space:pre;box-sizing:border-box;background-color:transparent;font-size:14px;color:#3f3f3f}.r6o-autocomplete ul{position:absolute;margin:0;padding:0;list-style-type:none;background-color:#fff;border-radius:3px;border:1px solid #d6d7d9;box-sizing:border-box;box-shadow:0 0 20px rgba(0,0,0,.25)}.r6o-autocomplete ul:empty{display:none}.r6o-autocomplete li{box-sizing:border-box;padding:2px 12px;width:100%;cursor:pointer}.r6o-editable-text{max-height:120px;overflow:auto;outline:none;min-height:2em;font-size:14px;font-family:"Lato",sans-serif}.r6o-editable-text:empty:not(:focus):before{content:attr(data-placeholder);color:#c2c2c2}.r6o-widget.comment{font-size:14px;min-height:3em;background-color:#fff;position:relative}.r6o-widget.comment .r6o-editable-text,.r6o-widget.comment .r6o-readonly-comment{padding:10px;width:100%;box-sizing:border-box;outline:none;border:none;background-color:transparent;resize:none}.r6o-widget.comment .r6o-readonly-comment{white-space:pre}.r6o-widget.comment .r6o-editable-text::-webkit-input-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text::-moz-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text:-moz-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text:-ms-input-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-lastmodified{border:1px solid #e5e5e5;display:inline-block;border-radius:2px;margin:0 10px 8px 10px;padding:4px 5px;line-height:100%;font-size:12px}.r6o-widget.comment .r6o-lastmodified .r6o-lastmodified-at{color:#757575;padding-left:3px}.r6o-widget.comment .r6o-arrow-down{position:absolute;height:20px;width:20px;top:9px;right:9px;line-height:22px;background-color:#fff;text-align:center;-webkit-font-smoothing:antialiased;border:1px solid #e5e5e5;cursor:pointer;-webkit-border-radius:1px;-khtml-border-radius:1px;-moz-border-radius:1px;border-radius:1px}.r6o-widget.comment .r6o-arrow-down.r6o-menu-open{border-color:#4483c4}.r6o-widget.comment .r6o-comment-dropdown-menu{position:absolute;top:32px;right:8px;background-color:#fff;border:1px solid #e5e5e5;list-style-type:none;margin:0;padding:5px 0;z-index:9999;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.2);-moz-box-shadow:0 2px 4px rgba(0,0,0,.2);box-shadow:0 2px 4px rgba(0,0,0,.2)}.r6o-widget.comment .r6o-comment-dropdown-menu li{padding:0 15px;cursor:pointer}.r6o-widget.comment .r6o-comment-dropdown-menu li:hover{background-color:#ecf0f1}.r6o-widget.comment .r6o-purposedropdown{position:relative;z-index:2}.r6o-widget.comment.editable{background-color:#ecf0f1}.r6o-widget.r6o-tag:empty{display:none}@media all and (-ms-high-contrast: none),(-ms-high-contrast: active){.r6o-widget.tag .r6o-taglist li{height:27px}.r6o-widget.tag .r6o-taglist li .r6o-delete-wrapper .r6o-delete{position:relative;top:-4px}}.r6o-widget.r6o-tag{background-color:#ecf0f1;border-bottom:1px solid #e5e5e5;padding:1px 3px;display:flex}.r6o-widget.r6o-tag ul{margin:0;padding:0;list-style-type:none;z-index:1}.r6o-widget.r6o-tag ul.r6o-taglist{flex:0;white-space:nowrap}.r6o-widget.r6o-tag ul.r6o-taglist li{margin:0;display:inline-block;margin:1px 1px 1px 0;padding:0;vertical-align:middle;overflow:hidden;font-size:12px;background-color:#fff;border:1px solid #d6d7d9;cursor:pointer;position:relative;line-height:180%;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 4px rgba(0,0,0,.1);-moz-box-shadow:0 0 4px rgba(0,0,0,.1);box-shadow:0 0 4px rgba(0,0,0,.1)}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-label{padding:2px 8px;display:inline-block}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper{display:inline-block;padding:2px 0;color:#fff;width:0;height:100%;background-color:#4483c4;-webkit-border-top-right-radius:2px;-webkit-border-bottom-right-radius:2px;-khtml-border-radius-topright:2px;-khtml-border-radius-bottomright:2px;-moz-border-radius-topright:2px;-moz-border-radius-bottomright:2px;border-top-right-radius:2px;border-bottom-right-radius:2px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper .r6o-delete{padding:2px 6px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper svg{vertical-align:text-top}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-enter-active{width:24px;transition:width 200ms}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-enter-done{width:24px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-exit{width:24px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-exit-active{width:0;transition:width 200ms}.r6o-widget.r6o-tag .r6o-autocomplete{flex:1;position:relative}.r6o-widget.r6o-tag .r6o-autocomplete li{font-size:14px}.r6o-widget.r6o-tag input{width:100%;padding:0 3px;min-width:80px;outline:none;border:none;line-height:170%;background-color:transparent;color:#3f3f3f}.r6o-widget.r6o-tag input::-webkit-input-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input::-moz-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input:-moz-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input:-ms-input-placeholder{color:#c2c2c2}.r6o-editor{position:absolute;z-index:99999;width:400px;color:#3f3f3f;opacity:0;font-family:"Lato",sans-serif;font-size:17px;line-height:27px;-webkit-transition:opacity .2s ease-in;-moz-transition:opacity .2s ease-in;transition:opacity .2s ease-in}.r6o-editor .r6o-arrow{position:absolute;overflow:hidden;top:-12px;left:12px;width:28px;height:12px;display:none}.r6o-editor .r6o-arrow:after{content:"";position:absolute;top:5px;left:5px;width:18px;height:18px;background-color:#fff;-webkit-backface-visibility:hidden;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.r6o-editor .r6o-editor-inner{background-color:#fff;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px;-webkit-box-shadow:2px 2px 42px rgba(0,0,0,.4);-moz-box-shadow:2px 2px 42px rgba(0,0,0,.4);box-shadow:2px 2px 42px rgba(0,0,0,.4)}.r6o-editor .r6o-editor-inner .r6o-widget:first-child{-webkit-border-top-left-radius:2px;-webkit-border-top-right-radius:2px;-khtml-border-radius-topleft:2px;-khtml-border-radius-topright:2px;-moz-border-radius-topleft:2px;-moz-border-radius-topright:2px;border-top-left-radius:2px;border-top-right-radius:2px}.r6o-editor .r6o-editor-inner .r6o-widget{border-bottom:1px solid #e5e5e5}.r6o-editor .r6o-footer{position:relative;text-align:right;padding:8px 0}.r6o-editor .r6o-footer .r6o-btn{margin-right:8px}.r6o-editor .r6o-footer .r6o-btn.delete-annotation{position:absolute;top:7px;left:7px;background-color:transparent;border:none;color:#4483c4;width:32px;height:32px;min-width:0;border-radius:100%;padding:0;display:flex;justify-content:center;align-items:center;-webkit-transition:all .1s ease-in;-moz-transition:all .1s ease-in;-o-transition:all .1s ease-in;transition:all .1s ease-in}.r6o-editor .r6o-footer .r6o-btn.delete-annotation:hover{color:#fff;background-color:#ef352c}@media(max-width: 640px){.r6o-editor{width:260px}}.r6o-editor.r6o-arrow-top .r6o-arrow{display:block}.r6o-editor.r6o-arrow-right{margin-left:8px}.r6o-editor.r6o-arrow-right .r6o-arrow{left:auto;right:12px}.r6o-editor.r6o-arrow-bottom .r6o-arrow{display:block;top:auto;bottom:-12px}.r6o-editor.r6o-arrow-bottom .r6o-arrow::after{top:-11px;box-shadow:none}.r6o-editor.pushed .r6o-arrow,.r6o-editor.dragged .r6o-arrow{display:none}.r6o-editor .r6o-draggable{cursor:move}.r6o-purposedropdown{width:150px;display:inline-block}.r6o-noselect{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.r6o-editor{margin-left:-12px}.r6o-annotation{background-color:rgba(255,165,0,.2);border-bottom:2px solid orange;cursor:pointer}.r6o-selection{background-color:rgba(207,207,255,.63);cursor:pointer}.r6o-hide-selection::selection,.r6o-hide-selection ::selection{background:transparent}.r6o-hide-selection::-moz-selection .r6o-hide-selection ::-moz-selection{background:transparent}.r6o-relation-editor{position:absolute;font-family:"Lato",sans-serif;font-size:17px;line-height:27px;-webkit-box-shadow:0 1px 14px rgba(0,0,0,.4);-moz-box-shadow:0 1px 14px rgba(0,0,0,.4);box-shadow:0 1px 14px rgba(0,0,0,.4);-webkit-border-radius:3px;-khtml-border-radius:3px;-moz-border-radius:3px;border-radius:3px;transform:translate(-50%, -50%);background-color:#fff}.r6o-relation-editor svg{vertical-align:middle;shape-rendering:geometricPrecision}.r6o-relation-editor *{box-sizing:border-box}.r6o-relation-editor .input-wrapper{height:34px;padding:0 6px;margin-right:68px;font-size:14px;background-color:#ecf0f1;cursor:text;-webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-radius-topleft:3px;-khtml-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px;-moz-border-radius-bottomleft:3px;border-top-left-radius:3px;border-bottom-left-radius:3px}.r6o-relation-editor .input-wrapper .r6o-autocomplete ul{position:relative;left:-6px}.r6o-relation-editor .buttons{position:absolute;display:inline-flex;top:0;right:0}.r6o-relation-editor .buttons span{height:34px;display:inline-block;width:34px;text-align:center;font-size:14px;cursor:pointer;padding:1px 0}.r6o-relation-editor .buttons .delete{background-color:#fff;color:#9ca4b1;border-left:1px solid #e5e5e5}.r6o-relation-editor .buttons .delete:hover{background-color:#f6f6f6}.r6o-relation-editor .buttons .ok{background-color:#4483c4;color:#fff;-webkit-border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;-khtml-border-radius-topright:3px;-khtml-border-radius-bottomright:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px;border-top-right-radius:3px;border-bottom-right-radius:3px}.r6o-relation-editor .buttons .ok:hover{background-color:#4f92d7}
@@ -40562,12 +40601,16 @@ body {
40562
40601
  box-sizing: border-box;
40563
40602
  background-color: #f5f5f5;
40564
40603
  font-family: Arial, sans-serif;
40604
+ overflow: hidden; /* Prevent window from scrolling */
40565
40605
  }
40566
40606
 
40567
40607
  .formio-wrapper {
40568
40608
  border: 1px solid #ccc;
40569
40609
  background-color: #fff;
40570
40610
  border-radius: 8px;
40611
+ overflow-y: auto; /* Enable internal scrolling */
40612
+ -webkit-overflow-scrolling: touch;
40613
+ height: 100%; /* Fill space */
40571
40614
  }
40572
40615
 
40573
40616
  #progressContainer {
@@ -41126,6 +41169,41 @@ body {
41126
41169
  margin-right: auto;
41127
41170
 
41128
41171
  }
41172
+
41173
+ /* Prevent iOS zoom/jump on Select search input by ensuring font-size is 16px */
41174
+ .ui.form .choices[data-type*='select-one'] input.choices__input {
41175
+ font-size: 16px !important;
41176
+ }
41177
+
41178
+ /* Add buffer at bottom to allow last components to scroll above the keyboard */
41179
+ #formio-wrapper {
41180
+ padding-bottom: 800px !important;
41181
+ }
41182
+
41183
+ /* Logically add space below the select when opened to allow scrolling the last row higher */
41184
+ .choices.is-open {
41185
+ margin-bottom: 800px !important;
41186
+ overflow: visible !important;
41187
+ }
41188
+
41189
+ /* Prevent dropdown from being layered behind table headers or other rows */
41190
+ .choices__list--dropdown {
41191
+ z-index: 10000 !important;
41192
+ overflow-y: auto !important;
41193
+ -webkit-overflow-scrolling: touch;
41194
+ }
41195
+
41196
+ /* Ensure the internal list doesn't have its own scrollbar/max-height that clips items */
41197
+ .choices__list--dropdown .choices__list {
41198
+ max-height: none !important;
41199
+ overflow: visible !important;
41200
+ padding-bottom: 20px !important;
41201
+ }
41202
+
41203
+ /* Add extra space for the last item to ensure it's not clipped on iOS */
41204
+ .choices__list--dropdown .choices__item:last-child {
41205
+ padding-bottom: 20px !important;
41206
+ }
41129
41207
  }</style>
41130
41208
 
41131
41209
  <script>
@@ -47031,9 +47109,9 @@ var Choices = /** @class */function () {
47031
47109
  requestAnimationFrame(function () {
47032
47110
  _this.dropdown.show();
47033
47111
  _this.containerOuter.open(_this.dropdown.distanceFromTopWindow);
47034
- if (!preventInputFocus && _this._canSearch) {
47035
- _this.input.focus();
47036
- }
47112
+ if (!preventInputFocus && _this._canSearch) {
47113
+ _this.input.focus({ preventScroll: true });
47114
+ }
47037
47115
  _this.passedElement.triggerEvent(constants_1.EVENTS.showDropdown, {});
47038
47116
  });
47039
47117
  return this;
@@ -47515,7 +47593,7 @@ var Choices = /** @class */function () {
47515
47593
  });
47516
47594
  // Focus input as without focus, a user cannot do anything with a
47517
47595
  // highlighted item
47518
- this.input.focus();
47596
+ this.input.focus({ preventScroll: true });
47519
47597
  };
47520
47598
  Choices.prototype._handleChoiceAction = function (activeItems, element) {
47521
47599
  if (!activeItems || !element) {
@@ -47944,7 +48022,7 @@ var Choices = /** @class */function () {
47944
48022
  var containerWasExactTarget = target === this.containerOuter.element || target === this.containerInner.element;
47945
48023
  if (containerWasExactTarget) {
47946
48024
  if (this._isTextElement) {
47947
- this.input.focus();
48025
+ this.input.focus({ preventScroll: true });
47948
48026
  } else if (this._isSelectMultipleElement) {
47949
48027
  this.showDropdown();
47950
48028
  }
@@ -48004,11 +48082,12 @@ var Choices = /** @class */function () {
48004
48082
  if (!this.dropdown.isActive && !this.containerOuter.isDisabled) {
48005
48083
  if (this._isTextElement) {
48006
48084
  if (document.activeElement !== this.input.element) {
48007
- this.input.focus();
48085
+ this.input.focus({ preventScroll: true });
48008
48086
  }
48009
48087
  } else {
48010
48088
  this.showDropdown();
48011
- this.containerOuter.focus();
48089
+ // Always focus container to trigger keyboard close if switching fields
48090
+ this.containerOuter.focus({ preventScroll: true });
48012
48091
  }
48013
48092
  } else if (this._isSelectOneElement && target !== this.input.element && !this.dropdown.element.contains(target)) {
48014
48093
  this.hideDropdown();
@@ -48087,7 +48166,7 @@ var Choices = /** @class */function () {
48087
48166
  // closes the dropdown. To stop this, we refocus our input
48088
48167
  // if we know we are on IE *and* are scrolling.
48089
48168
  this._isScrollingOnIe = false;
48090
- this.input.element.focus();
48169
+ this.input.element.focus({ preventScroll: true });
48091
48170
  }
48092
48171
  };
48093
48172
  Choices.prototype._onFormReset = function () {
@@ -54570,7 +54649,7 @@ class SmartSelectComponent extends SmartSelectField {
54570
54649
  noChoicesText: this.t('No choices to choose from'),
54571
54650
  searchPlaceholderValue: this.t('Type to search'),
54572
54651
  shouldSort: false,
54573
- position: (this.component.dropdown || 'auto'),
54652
+ position: this.component.dropdown ? this.component.dropdown : (window.platform && window.platform.iosPlatform ? "bottom" : "auto"),
54574
54653
  searchEnabled: useSearch,
54575
54654
  searchChoices: !this.component.searchField,
54576
54655
  searchFields: _.get(this, 'component.searchFields', ['label']),
@@ -54657,10 +54736,16 @@ class SmartSelectComponent extends SmartSelectField {
54657
54736
  if (this.component.multiple) {
54658
54737
  this.focusableElement = this.choices.input.element;
54659
54738
  } else {
54660
- this.focusableElement = this.choices.containerInner.element;
54739
+ // On iOS, focus the search input even for single select to ensure keyboard opens and centering logic works
54740
+ if (choicesOptions.searchEnabled && window.platform && window.platform.iosPlatform) {
54741
+ this.focusableElement = this.choices.input.element;
54742
+ } else {
54743
+ this.focusableElement = this.choices.containerInner.element;
54744
+ }
54661
54745
  this.choices.containerOuter.element.setAttribute('tabIndex', '-1');
54662
54746
  if (choicesOptions.searchEnabled) {
54663
- this.addEventListener(this.choices.containerOuter.element, 'focus', () => this.focusableElement.focus());
54747
+ // Proactively position on mousedown so it's ready before focus happens
54748
+ this.addEventListener(this.choices.containerOuter.element, 'mousedown', () => this.positionDropdown());
54664
54749
  }
54665
54750
  }
54666
54751
  this.addFocusBlurEvents(this.focusableElement);
@@ -54677,6 +54762,12 @@ class SmartSelectComponent extends SmartSelectField {
54677
54762
  }
54678
54763
  }
54679
54764
  if (window && this.choices && this.shouldPositionDropdown) {
54765
+ const wrapper = document.getElementById('formio-wrapper');
54766
+ if (wrapper) {
54767
+ this.addEventListener(wrapper, 'scroll', () => {
54768
+ this.positionDropdown(true);
54769
+ }, false, true);
54770
+ }
54680
54771
  this.addEventListener(window.document, 'scroll', () => {
54681
54772
  this.positionDropdown(true);
54682
54773
  }, false, true);
@@ -54787,26 +54878,97 @@ class SmartSelectComponent extends SmartSelectField {
54787
54878
  dataObj.skip = this.defaultDownloadedResources.length + this.component.limit;
54788
54879
  this.setItems(this.defaultDownloadedResources);
54789
54880
  }
54881
+ });
54882
+
54883
+ this.addEventListener(input, 'hideDropdown', () => {
54884
+ const container = document.getElementById('form-container');
54885
+ const currentScroll = container ? container.scrollTop : 0;
54790
54886
 
54791
54887
  if (this.choices && this.choices.input && this.choices.input.element) {
54792
54888
  this.choices.input.element.value = '';
54793
54889
  }
54794
- this.updateItems(null, true);
54890
+ // Only update items if it's really necessary (e.g. clearing masterdata search)
54891
+ // Redrawing on hide often causes scroll jumps on iOS
54892
+ if (this.component.dataSrc === 'masterdata') {
54893
+ this.updateItems(null, true);
54894
+ }
54895
+
54896
+ // Restore scroll after hide/blur jump
54897
+ if (container && currentScroll > 0) {
54898
+ // Restore if jumping to top or significant shift, but ignore if we recently clicked another select
54899
+ requestAnimationFrame(() => {
54900
+ if (container.scrollTop === 0 && !window._unv_selecting) {
54901
+ container.scrollTop = currentScroll;
54902
+ }
54903
+ });
54904
+ }
54795
54905
  });
54796
54906
  }
54797
54907
 
54908
+ this.addEventListener(input, 'mousedown', () => {
54909
+ window._unv_selecting = true;
54910
+ // Force full keyboard cycle on iOS to prevent layout "ghosting" from previous field
54911
+ if (window.platform && window.platform.iosPlatform && document.activeElement && (document.activeElement.tagName === 'INPUT' || document.activeElement.classList.contains('choices__input'))) {
54912
+ document.activeElement.blur();
54913
+ }
54914
+ setTimeout(() => { window._unv_selecting = false; }, 500);
54915
+ this.positionDropdown();
54916
+ });
54917
+
54798
54918
  this.addEventListener(input, 'showDropdown', () => {
54799
- this.update();
54919
+ const container = document.getElementById('form-container');
54920
+ const currentScroll = container ? container.scrollTop : 0;
54921
+
54922
+ if (!this.activated) {
54923
+ this.update();
54924
+ }
54800
54925
  this.positionDropdown();
54926
+
54927
+ // Ensure select is visible above keyboard on iOS
54928
+ if (window.platform && window.platform.iosPlatform) {
54929
+ // We removed native scrollIntoView as it interferes with manual scroll control in focus.js
54930
+ // focus.js handles the centering now.
54931
+ }
54932
+
54933
+ // Restore and lock scroll on iPad to prevent "flicker" shifts during keyboard toggles
54934
+ if (container && currentScroll > 0 && window.platform && window.platform.iosPlatform) {
54935
+ // Immediate restoration
54936
+ container.scrollTop = currentScroll;
54937
+
54938
+ // Follow-up restoration for async layout shifts
54939
+ requestAnimationFrame(() => {
54940
+ container.scrollTop = currentScroll;
54941
+ });
54942
+
54943
+ // Periodical restoration during the typical keyboard transition time (300ms)
54944
+ let count = 0;
54945
+ const interval = setInterval(() => {
54946
+ if (container.scrollTop !== currentScroll) {
54947
+ container.scrollTop = currentScroll;
54948
+ }
54949
+ if (++count > 10) clearInterval(interval);
54950
+ }, 30);
54951
+ } else if (container && currentScroll > 0) {
54952
+ // Standard restoration for other platforms
54953
+ requestAnimationFrame(() => {
54954
+ if (container.scrollTop === 0) {
54955
+ container.scrollTop = currentScroll;
54956
+ }
54957
+ });
54958
+ }
54959
+
54801
54960
  if ((this.component.dataSrc === 'masterdata') && this.component.masterdata) {
54802
54961
  this.component.dropdownOpened = true;
54803
- if (this.defaultDownloadedResources && ((this.defaultDownloadedResources.length == 1) || ((this.defaultDownloadedResources.length < this.component.limit) && this.component.multiple))) {
54804
- this.defaultDownloadedResources = [];
54805
- this.setMasterdata();
54806
- } else if (this.defaultDownloadedResources && this.defaultDownloadedResources.length > 0) {
54807
- this.setItems(this.defaultDownloadedResources);
54808
- } else {
54809
- this.setMasterdata();
54962
+ // Avoid redundant setItems if we already have the data
54963
+ if (!this.defaultDownloadedResources || this.defaultDownloadedResources.length === 0) {
54964
+ if (this.defaultDownloadedResources && ((this.defaultDownloadedResources.length == 1) || ((this.defaultDownloadedResources.length < this.component.limit) && this.component.multiple))) {
54965
+ this.defaultDownloadedResources = [];
54966
+ this.setMasterdata();
54967
+ } else if (this.defaultDownloadedResources && this.defaultDownloadedResources.length > 0) {
54968
+ this.setItems(this.defaultDownloadedResources);
54969
+ } else {
54970
+ this.setMasterdata();
54971
+ }
54810
54972
  }
54811
54973
  }
54812
54974
  });
@@ -54858,6 +55020,12 @@ class SmartSelectComponent extends SmartSelectField {
54858
55020
  this.disabled = this.shouldDisabled;
54859
55021
  this.updateItems();
54860
55022
  this.triggerUpdate();
55023
+
55024
+ // If not lazy loading, mark as activated to avoid redraw on first open
55025
+ if (!this.component.lazyLoad) {
55026
+ this.activated = true;
55027
+ }
55028
+
54861
55029
  return superAttach;
54862
55030
  }
54863
55031
  setDropdownPosition() {
@@ -54877,14 +55045,29 @@ class SmartSelectComponent extends SmartSelectField {
54877
55045
  const containerPosition = container.getBoundingClientRect();
54878
55046
  const isFlipped = container.classList.contains('is-flipped');
54879
55047
 
54880
- _.assign(dropdown.style, {
54881
- top: `${isFlipped ? containerPosition.top - dropdown.offsetHeight : containerPosition.top + containerPosition.height}px`,
55048
+ const vpH = window.visualViewport ? window.visualViewport.height : window.innerHeight;
55049
+ const top = isFlipped ? containerPosition.top - dropdown.offsetHeight : containerPosition.top + containerPosition.height;
55050
+
55051
+ const style = {
54882
55052
  left: `${containerPosition.left}px`,
54883
55053
  width: `${containerPosition.width}px`,
54884
55054
  position: 'fixed',
54885
55055
  bottom: 'unset',
54886
55056
  right: 'unset',
54887
- });
55057
+ top: `${top}px`,
55058
+ };
55059
+
55060
+ // On iOS, we limit the max-height of the fixed dropdown to stay within the viewport.
55061
+ // We also use a scroll listener on the wrapper (added in attach()) to ensure this fixed
55062
+ // element re-positions during scrolling, making it behave like an absolute element.
55063
+ if (window.platform && window.platform.iosPlatform) {
55064
+ // Limit max-height to available space but ensure at least 300px for a good scroll area.
55065
+ // We subtract 30px to leave a small gap at the bottom for better visibility.
55066
+ const availableHeight = isFlipped ? top - 20 : vpH - top - 30;
55067
+ style.maxHeight = `${Math.max(availableHeight, 300)}px`;
55068
+ }
55069
+
55070
+ _.assign(dropdown.style, style);
54888
55071
  }
54889
55072
 
54890
55073
  hasDataGridAncestor(comp) {
@@ -56779,7 +56962,12 @@ class ColumnsComponent extends ColumnsNestedComponent {
56779
56962
  const redraw = this.justify();
56780
56963
 
56781
56964
  if (redraw) {
56782
- this.redraw();
56965
+ // Avoid redrawing columns if an input is focused to prevent scroll/focus loss
56966
+ const activeEl = document.activeElement;
56967
+ const isFocusable = activeEl && (activeEl.tagName === 'INPUT' || activeEl.tagName === 'TEXTAREA' || activeEl.classList.contains('choices__input'));
56968
+ if (!isFocusable) {
56969
+ this.redraw();
56970
+ }
56783
56971
  }
56784
56972
  }
56785
56973
 
@@ -60499,7 +60687,7 @@ window.CommentOnBack = CommentOnBack;
60499
60687
 
60500
60688
 
60501
60689
  <div id="sticky-footer">
60502
- <div class="build-version">SDK v1.0.20</div>
60690
+ <div class="build-version">SDK v1.0.22</div>
60503
60691
  <div class="relative-position">
60504
60692
  <button id="unvired-more-btn" class="ui button primary dataGrid-addRow" onclick="toggleTooltip()">
60505
60693
  <i class="icon options"></i>
@@ -1489,12 +1489,16 @@ body {
1489
1489
  box-sizing: border-box;
1490
1490
  background-color: #f5f5f5;
1491
1491
  font-family: Arial, sans-serif;
1492
+ overflow: hidden; /* Prevent window from scrolling */
1492
1493
  }
1493
1494
 
1494
1495
  .formio-wrapper {
1495
1496
  border: 1px solid #ccc;
1496
1497
  background-color: #fff;
1497
1498
  border-radius: 8px;
1499
+ overflow-y: auto; /* Enable internal scrolling */
1500
+ -webkit-overflow-scrolling: touch;
1501
+ height: 100%; /* Fill space */
1498
1502
  }
1499
1503
 
1500
1504
  #progressContainer {
@@ -2053,6 +2057,41 @@ body {
2053
2057
  margin-right: auto;
2054
2058
 
2055
2059
  }
2060
+
2061
+ /* Prevent iOS zoom/jump on Select search input by ensuring font-size is 16px */
2062
+ .ui.form .choices[data-type*='select-one'] input.choices__input {
2063
+ font-size: 16px !important;
2064
+ }
2065
+
2066
+ /* Add buffer at bottom to allow last components to scroll above the keyboard */
2067
+ #formio-wrapper {
2068
+ padding-bottom: 800px !important;
2069
+ }
2070
+
2071
+ /* Logically add space below the select when opened to allow scrolling the last row higher */
2072
+ .choices.is-open {
2073
+ margin-bottom: 800px !important;
2074
+ overflow: visible !important;
2075
+ }
2076
+
2077
+ /* Prevent dropdown from being layered behind table headers or other rows */
2078
+ .choices__list--dropdown {
2079
+ z-index: 10000 !important;
2080
+ overflow-y: auto !important;
2081
+ -webkit-overflow-scrolling: touch;
2082
+ }
2083
+
2084
+ /* Ensure the internal list doesn't have its own scrollbar/max-height that clips items */
2085
+ .choices__list--dropdown .choices__list {
2086
+ max-height: none !important;
2087
+ overflow: visible !important;
2088
+ padding-bottom: 20px !important;
2089
+ }
2090
+
2091
+ /* Add extra space for the last item to ensure it's not clipped on iOS */
2092
+ .choices__list--dropdown .choices__item:last-child {
2093
+ padding-bottom: 20px !important;
2094
+ }
2056
2095
  }
2057
2096
 
2058
2097
  /* === STYLE_SEPARATOR === */
@@ -27883,7 +27922,7 @@ select.ui.dropdown {
27883
27922
  <div id="formio-cmt" style="margin-bottom: 20px;"></div>
27884
27923
  </div>
27885
27924
  <div id="sticky-footer">
27886
- <div class="build-version">SDK v1.0.20</div>
27925
+ <div class="build-version">SDK v1.0.22</div>
27887
27926
  <button class="ui button primary dataGrid-addRow" id="saveBtn" disabled="true" onclick="FormOnSave()">
27888
27927
  <i class="icon save large"></i>Save
27889
27928
  </button>
@@ -54299,9 +54338,9 @@ var Choices = /** @class */function () {
54299
54338
  requestAnimationFrame(function () {
54300
54339
  _this.dropdown.show();
54301
54340
  _this.containerOuter.open(_this.dropdown.distanceFromTopWindow);
54302
- if (!preventInputFocus && _this._canSearch) {
54303
- _this.input.focus();
54304
- }
54341
+ if (!preventInputFocus && _this._canSearch) {
54342
+ _this.input.focus({ preventScroll: true });
54343
+ }
54305
54344
  _this.passedElement.triggerEvent(constants_1.EVENTS.showDropdown, {});
54306
54345
  });
54307
54346
  return this;
@@ -54783,7 +54822,7 @@ var Choices = /** @class */function () {
54783
54822
  });
54784
54823
  // Focus input as without focus, a user cannot do anything with a
54785
54824
  // highlighted item
54786
- this.input.focus();
54825
+ this.input.focus({ preventScroll: true });
54787
54826
  };
54788
54827
  Choices.prototype._handleChoiceAction = function (activeItems, element) {
54789
54828
  if (!activeItems || !element) {
@@ -55212,7 +55251,7 @@ var Choices = /** @class */function () {
55212
55251
  var containerWasExactTarget = target === this.containerOuter.element || target === this.containerInner.element;
55213
55252
  if (containerWasExactTarget) {
55214
55253
  if (this._isTextElement) {
55215
- this.input.focus();
55254
+ this.input.focus({ preventScroll: true });
55216
55255
  } else if (this._isSelectMultipleElement) {
55217
55256
  this.showDropdown();
55218
55257
  }
@@ -55272,11 +55311,12 @@ var Choices = /** @class */function () {
55272
55311
  if (!this.dropdown.isActive && !this.containerOuter.isDisabled) {
55273
55312
  if (this._isTextElement) {
55274
55313
  if (document.activeElement !== this.input.element) {
55275
- this.input.focus();
55314
+ this.input.focus({ preventScroll: true });
55276
55315
  }
55277
55316
  } else {
55278
55317
  this.showDropdown();
55279
- this.containerOuter.focus();
55318
+ // Always focus container to trigger keyboard close if switching fields
55319
+ this.containerOuter.focus({ preventScroll: true });
55280
55320
  }
55281
55321
  } else if (this._isSelectOneElement && target !== this.input.element && !this.dropdown.element.contains(target)) {
55282
55322
  this.hideDropdown();
@@ -55355,7 +55395,7 @@ var Choices = /** @class */function () {
55355
55395
  // closes the dropdown. To stop this, we refocus our input
55356
55396
  // if we know we are on IE *and* are scrolling.
55357
55397
  this._isScrollingOnIe = false;
55358
- this.input.element.focus();
55398
+ this.input.element.focus({ preventScroll: true });
55359
55399
  }
55360
55400
  };
55361
55401
  Choices.prototype._onFormReset = function () {
@@ -61839,7 +61879,7 @@ class SmartSelectComponent extends SmartSelectField {
61839
61879
  noChoicesText: this.t('No choices to choose from'),
61840
61880
  searchPlaceholderValue: this.t('Type to search'),
61841
61881
  shouldSort: false,
61842
- position: (this.component.dropdown || 'auto'),
61882
+ position: this.component.dropdown ? this.component.dropdown : (window.platform && window.platform.iosPlatform ? "bottom" : "auto"),
61843
61883
  searchEnabled: useSearch,
61844
61884
  searchChoices: !this.component.searchField,
61845
61885
  searchFields: _.get(this, 'component.searchFields', ['label']),
@@ -61926,10 +61966,16 @@ class SmartSelectComponent extends SmartSelectField {
61926
61966
  if (this.component.multiple) {
61927
61967
  this.focusableElement = this.choices.input.element;
61928
61968
  } else {
61929
- this.focusableElement = this.choices.containerInner.element;
61969
+ // On iOS, focus the search input even for single select to ensure keyboard opens and centering logic works
61970
+ if (choicesOptions.searchEnabled && window.platform && window.platform.iosPlatform) {
61971
+ this.focusableElement = this.choices.input.element;
61972
+ } else {
61973
+ this.focusableElement = this.choices.containerInner.element;
61974
+ }
61930
61975
  this.choices.containerOuter.element.setAttribute('tabIndex', '-1');
61931
61976
  if (choicesOptions.searchEnabled) {
61932
- this.addEventListener(this.choices.containerOuter.element, 'focus', () => this.focusableElement.focus());
61977
+ // Proactively position on mousedown so it's ready before focus happens
61978
+ this.addEventListener(this.choices.containerOuter.element, 'mousedown', () => this.positionDropdown());
61933
61979
  }
61934
61980
  }
61935
61981
  this.addFocusBlurEvents(this.focusableElement);
@@ -61946,6 +61992,12 @@ class SmartSelectComponent extends SmartSelectField {
61946
61992
  }
61947
61993
  }
61948
61994
  if (window && this.choices && this.shouldPositionDropdown) {
61995
+ const wrapper = document.getElementById('formio-wrapper');
61996
+ if (wrapper) {
61997
+ this.addEventListener(wrapper, 'scroll', () => {
61998
+ this.positionDropdown(true);
61999
+ }, false, true);
62000
+ }
61949
62001
  this.addEventListener(window.document, 'scroll', () => {
61950
62002
  this.positionDropdown(true);
61951
62003
  }, false, true);
@@ -62056,26 +62108,97 @@ class SmartSelectComponent extends SmartSelectField {
62056
62108
  dataObj.skip = this.defaultDownloadedResources.length + this.component.limit;
62057
62109
  this.setItems(this.defaultDownloadedResources);
62058
62110
  }
62111
+ });
62112
+
62113
+ this.addEventListener(input, 'hideDropdown', () => {
62114
+ const container = document.getElementById('form-container');
62115
+ const currentScroll = container ? container.scrollTop : 0;
62059
62116
 
62060
62117
  if (this.choices && this.choices.input && this.choices.input.element) {
62061
62118
  this.choices.input.element.value = '';
62062
62119
  }
62063
- this.updateItems(null, true);
62120
+ // Only update items if it's really necessary (e.g. clearing masterdata search)
62121
+ // Redrawing on hide often causes scroll jumps on iOS
62122
+ if (this.component.dataSrc === 'masterdata') {
62123
+ this.updateItems(null, true);
62124
+ }
62125
+
62126
+ // Restore scroll after hide/blur jump
62127
+ if (container && currentScroll > 0) {
62128
+ // Restore if jumping to top or significant shift, but ignore if we recently clicked another select
62129
+ requestAnimationFrame(() => {
62130
+ if (container.scrollTop === 0 && !window._unv_selecting) {
62131
+ container.scrollTop = currentScroll;
62132
+ }
62133
+ });
62134
+ }
62064
62135
  });
62065
62136
  }
62066
62137
 
62138
+ this.addEventListener(input, 'mousedown', () => {
62139
+ window._unv_selecting = true;
62140
+ // Force full keyboard cycle on iOS to prevent layout "ghosting" from previous field
62141
+ if (window.platform && window.platform.iosPlatform && document.activeElement && (document.activeElement.tagName === 'INPUT' || document.activeElement.classList.contains('choices__input'))) {
62142
+ document.activeElement.blur();
62143
+ }
62144
+ setTimeout(() => { window._unv_selecting = false; }, 500);
62145
+ this.positionDropdown();
62146
+ });
62147
+
62067
62148
  this.addEventListener(input, 'showDropdown', () => {
62068
- this.update();
62149
+ const container = document.getElementById('form-container');
62150
+ const currentScroll = container ? container.scrollTop : 0;
62151
+
62152
+ if (!this.activated) {
62153
+ this.update();
62154
+ }
62069
62155
  this.positionDropdown();
62156
+
62157
+ // Ensure select is visible above keyboard on iOS
62158
+ if (window.platform && window.platform.iosPlatform) {
62159
+ // We removed native scrollIntoView as it interferes with manual scroll control in focus.js
62160
+ // focus.js handles the centering now.
62161
+ }
62162
+
62163
+ // Restore and lock scroll on iPad to prevent "flicker" shifts during keyboard toggles
62164
+ if (container && currentScroll > 0 && window.platform && window.platform.iosPlatform) {
62165
+ // Immediate restoration
62166
+ container.scrollTop = currentScroll;
62167
+
62168
+ // Follow-up restoration for async layout shifts
62169
+ requestAnimationFrame(() => {
62170
+ container.scrollTop = currentScroll;
62171
+ });
62172
+
62173
+ // Periodical restoration during the typical keyboard transition time (300ms)
62174
+ let count = 0;
62175
+ const interval = setInterval(() => {
62176
+ if (container.scrollTop !== currentScroll) {
62177
+ container.scrollTop = currentScroll;
62178
+ }
62179
+ if (++count > 10) clearInterval(interval);
62180
+ }, 30);
62181
+ } else if (container && currentScroll > 0) {
62182
+ // Standard restoration for other platforms
62183
+ requestAnimationFrame(() => {
62184
+ if (container.scrollTop === 0) {
62185
+ container.scrollTop = currentScroll;
62186
+ }
62187
+ });
62188
+ }
62189
+
62070
62190
  if ((this.component.dataSrc === 'masterdata') && this.component.masterdata) {
62071
62191
  this.component.dropdownOpened = true;
62072
- if (this.defaultDownloadedResources && ((this.defaultDownloadedResources.length == 1) || ((this.defaultDownloadedResources.length < this.component.limit) && this.component.multiple))) {
62073
- this.defaultDownloadedResources = [];
62074
- this.setMasterdata();
62075
- } else if (this.defaultDownloadedResources && this.defaultDownloadedResources.length > 0) {
62076
- this.setItems(this.defaultDownloadedResources);
62077
- } else {
62078
- this.setMasterdata();
62192
+ // Avoid redundant setItems if we already have the data
62193
+ if (!this.defaultDownloadedResources || this.defaultDownloadedResources.length === 0) {
62194
+ if (this.defaultDownloadedResources && ((this.defaultDownloadedResources.length == 1) || ((this.defaultDownloadedResources.length < this.component.limit) && this.component.multiple))) {
62195
+ this.defaultDownloadedResources = [];
62196
+ this.setMasterdata();
62197
+ } else if (this.defaultDownloadedResources && this.defaultDownloadedResources.length > 0) {
62198
+ this.setItems(this.defaultDownloadedResources);
62199
+ } else {
62200
+ this.setMasterdata();
62201
+ }
62079
62202
  }
62080
62203
  }
62081
62204
  });
@@ -62127,6 +62250,12 @@ class SmartSelectComponent extends SmartSelectField {
62127
62250
  this.disabled = this.shouldDisabled;
62128
62251
  this.updateItems();
62129
62252
  this.triggerUpdate();
62253
+
62254
+ // If not lazy loading, mark as activated to avoid redraw on first open
62255
+ if (!this.component.lazyLoad) {
62256
+ this.activated = true;
62257
+ }
62258
+
62130
62259
  return superAttach;
62131
62260
  }
62132
62261
  setDropdownPosition() {
@@ -62146,14 +62275,29 @@ class SmartSelectComponent extends SmartSelectField {
62146
62275
  const containerPosition = container.getBoundingClientRect();
62147
62276
  const isFlipped = container.classList.contains('is-flipped');
62148
62277
 
62149
- _.assign(dropdown.style, {
62150
- top: \`\${isFlipped ? containerPosition.top - dropdown.offsetHeight : containerPosition.top + containerPosition.height}px\`,
62278
+ const vpH = window.visualViewport ? window.visualViewport.height : window.innerHeight;
62279
+ const top = isFlipped ? containerPosition.top - dropdown.offsetHeight : containerPosition.top + containerPosition.height;
62280
+
62281
+ const style = {
62151
62282
  left: \`\${containerPosition.left}px\`,
62152
62283
  width: \`\${containerPosition.width}px\`,
62153
62284
  position: 'fixed',
62154
62285
  bottom: 'unset',
62155
62286
  right: 'unset',
62156
- });
62287
+ top: \`\${top}px\`,
62288
+ };
62289
+
62290
+ // On iOS, we limit the max-height of the fixed dropdown to stay within the viewport.
62291
+ // We also use a scroll listener on the wrapper (added in attach()) to ensure this fixed
62292
+ // element re-positions during scrolling, making it behave like an absolute element.
62293
+ if (window.platform && window.platform.iosPlatform) {
62294
+ // Limit max-height to available space but ensure at least 300px for a good scroll area.
62295
+ // We subtract 30px to leave a small gap at the bottom for better visibility.
62296
+ const availableHeight = isFlipped ? top - 20 : vpH - top - 30;
62297
+ style.maxHeight = \`\${Math.max(availableHeight, 300)}px\`;
62298
+ }
62299
+
62300
+ _.assign(dropdown.style, style);
62157
62301
  }
62158
62302
 
62159
62303
  hasDataGridAncestor(comp) {
@@ -64053,7 +64197,12 @@ class ColumnsComponent extends ColumnsNestedComponent {
64053
64197
  const redraw = this.justify();
64054
64198
 
64055
64199
  if (redraw) {
64056
- this.redraw();
64200
+ // Avoid redrawing columns if an input is focused to prevent scroll/focus loss
64201
+ const activeEl = document.activeElement;
64202
+ const isFocusable = activeEl && (activeEl.tagName === 'INPUT' || activeEl.tagName === 'TEXTAREA' || activeEl.classList.contains('choices__input'));
64203
+ if (!isFocusable) {
64204
+ this.redraw();
64205
+ }
64057
64206
  }
64058
64207
  }
64059
64208
 
@@ -66237,6 +66386,161 @@ window.showDynamicModal = showDynamicModal;
66237
66386
 
66238
66387
  // === SCRIPT_SEPARATOR ===
66239
66388
 
66389
+ (function(){
66390
+ let isKeyboardOpen = false;
66391
+ let activeElement = null;
66392
+ const INITIAL_WINDOW_HEIGHT = window.innerHeight;
66393
+
66394
+ console.log("[Focus] Script initialized. Initial Height:", INITIAL_WINDOW_HEIGHT);
66395
+
66396
+ // SOFT LOCK
66397
+ window.addEventListener('scroll', () => {
66398
+ if (isKeyboardOpen && Math.abs(window.scrollY) > 20) {
66399
+ window.scrollTo(0, 0);
66400
+ }
66401
+ }, { passive: true });
66402
+
66403
+ function updateFooterVisibility(keyboardOpen) {
66404
+ // Only hide the footer on iOS to make room for the software keyboard.
66405
+ // On Windows/Desktop, we should keep the footer visible at all times.
66406
+ const isIOS = (window.platform && window.platform.iosPlatform);
66407
+ if (!isIOS) return;
66408
+
66409
+ const footer = document.getElementById('sticky-footer');
66410
+ if (!footer) return;
66411
+
66412
+ if (keyboardOpen) {
66413
+ footer.style.display = 'none';
66414
+ } else {
66415
+ footer.style.display = 'flex';
66416
+ }
66417
+ }
66418
+
66419
+ // Track focused input
66420
+ document.addEventListener('focusin', (e) => {
66421
+ const el = e.target;
66422
+ if (!el || !['INPUT', 'TEXTAREA', 'SELECT'].includes(el.tagName)) return;
66423
+
66424
+ console.log("[Focus] \u{1F3AF} focusin on:", el.name || el.id || el.tagName);
66425
+ updateFooterVisibility(true);
66426
+
66427
+ activeElement = el;
66428
+
66429
+ // Special handling for Choices.js: if an input inside choices is focused,
66430
+ // we want to ensure the whole container is considered the active element for centering
66431
+ if (el.classList.contains('choices__input')) {
66432
+ const container = el.closest('.choices');
66433
+ if (container) {
66434
+ activeElement = container;
66435
+ console.log("[Focus] \u{1F4E6} Choices.js detected, centering container.");
66436
+ }
66437
+ }
66438
+
66439
+ if (isKeyboardOpen) {
66440
+ console.log("[Focus] \u26A1 Already open, centering now.");
66441
+ centerActiveElement();
66442
+ }
66443
+ });
66444
+
66445
+ // Restore footer when focus is lost and keyboard is not open
66446
+ document.addEventListener('focusout', (e) => {
66447
+ setTimeout(() => {
66448
+ const currentlyFocused = document.activeElement;
66449
+ const isInputFocused = currentlyFocused && ['INPUT', 'TEXTAREA', 'SELECT'].includes(currentlyFocused.tagName);
66450
+
66451
+ if (!isInputFocused && !isKeyboardOpen) {
66452
+ console.log("[Focus] \u{1F6AA} focusout and keyboard closed, restoring footer.");
66453
+ updateFooterVisibility(false);
66454
+ }
66455
+ }, 200);
66456
+ });
66457
+
66458
+ // Detect keyboard open/close
66459
+ if (window.visualViewport) {
66460
+ window.visualViewport.addEventListener('resize', () => {
66461
+ const isIOS = (window.platform && window.platform.iosPlatform);
66462
+ if (!isIOS) return;
66463
+
66464
+ const viewport = window.visualViewport;
66465
+ const vpH = viewport.height;
66466
+ const isNowOpen = vpH < INITIAL_WINDOW_HEIGHT - 100;
66467
+
66468
+ if (isNowOpen) {
66469
+ const wasAlreadyOpen = isKeyboardOpen;
66470
+ isKeyboardOpen = true;
66471
+ updateFooterVisibility(true);
66472
+
66473
+ if (activeElement && !wasAlreadyOpen) {
66474
+ console.log("[Focus] \u{1F3A2} Keyboard sliding. Following...");
66475
+ startFollowingElement();
66476
+ }
66477
+ } else {
66478
+ isKeyboardOpen = false;
66479
+ updateFooterVisibility(false);
66480
+ window.scrollTo(0, 0);
66481
+ }
66482
+ });
66483
+ }
66484
+
66485
+ // Manually follow the element for a short duration to ensure it stays centered during animation
66486
+ function startFollowingElement() {
66487
+ let start = Date.now();
66488
+ const duration = 400; // Follow for 400ms (typical iOS keyboard duration)
66489
+
66490
+ function step() {
66491
+ centerActiveElement();
66492
+ if (Date.now() - start < duration) {
66493
+ requestAnimationFrame(step);
66494
+ }
66495
+ }
66496
+ requestAnimationFrame(step);
66497
+ }
66498
+
66499
+ function centerActiveElement() {
66500
+ if (!activeElement) return;
66501
+ const wrapper = document.getElementById('formio-wrapper');
66502
+ if (!wrapper) return;
66503
+
66504
+ const vpH = window.visualViewport ? window.visualViewport.height : window.innerHeight;
66505
+
66506
+ // Calculate absolute offset of element relative to wrapper
66507
+ let offsetTop = 0;
66508
+ let curr = activeElement;
66509
+ while (curr && curr !== wrapper && curr !== null) {
66510
+ offsetTop += curr.offsetTop;
66511
+ curr = curr.offsetParent;
66512
+ }
66513
+
66514
+ // For Choices.js, if the dropdown is open, we might want to adjust centering
66515
+ // to ensure the dropdown is visible. However, centering the container is usually best.
66516
+ const elementHeight = activeElement.offsetHeight;
66517
+
66518
+ // targetScroll = (distance from top) - (half of available space) + (half of element height)
66519
+ const targetScroll = offsetTop - (vpH / 2) + (elementHeight / 2);
66520
+
66521
+ // Apply instantly but accurately
66522
+ if (Math.abs(wrapper.scrollTop - targetScroll) > 5) {
66523
+ wrapper.scrollTop = targetScroll;
66524
+ }
66525
+ }
66526
+
66527
+ // Listen for Choices.js events to re-center when dropdown opens/closes
66528
+ document.addEventListener('showDropdown', () => {
66529
+ if (isKeyboardOpen) {
66530
+ console.log("[Focus] \u{1F53D} showDropdown detected, re-centering.");
66531
+ setTimeout(centerActiveElement, 100);
66532
+ }
66533
+ }, true);
66534
+
66535
+ document.addEventListener('hideDropdown', () => {
66536
+ console.log("[Focus] \u{1F53C} hideDropdown detected, resetting view.");
66537
+ // When dropdown hides, we might want to center the closed select again
66538
+ setTimeout(centerActiveElement, 100);
66539
+ }, true);
66540
+ })();
66541
+
66542
+ // === SCRIPT_SEPARATOR ===
66543
+
66240
66544
  (function(){
66241
66545
  var formObj = null;
66242
66546
  var initialFormData = null;
@@ -66578,6 +66882,7 @@ async function loadRNform(
66578
66882
  // Determine form configuration based on mode
66579
66883
  let formConfig = {
66580
66884
  noAlerts: true,
66885
+ scroll: false, // DISABLE Formio internal scrolling
66581
66886
  language: window.FORMIO_LANGUAGE || "en",
66582
66887
  i18n: window.FORMIO_I18N,
66583
66888
  };
@@ -66733,71 +67038,141 @@ async function loadRNform(
66733
67038
  setupOnChange(privateExternal, permission);
66734
67039
 
66735
67040
 
66736
- formObj.formReady.then(() => {
66737
- if (formPreviousData) {
66738
- formObj.submission = {
66739
- data:
66740
- typeof formPreviousData === "string"
66741
- ? JSON.parse(formPreviousData)
66742
- : formPreviousData,
66743
- };
66744
- }
67041
+ formObj.formReady
67042
+ .then(() => {
67043
+ console.log("[FormIO] \u{1F680} formReady.then() triggered");
66745
67044
 
66746
- // Calculate initial progress immediately
66747
- console.log("[FormIO] \u{1F4CA} Form ready \u2014 calculating initial progress...");
66748
- executeProgressCalculation(privateExternal, permission);
67045
+ if (formPreviousData) {
67046
+ console.log("[FormIO] \u{1F4E6} Previous form data found:", formPreviousData);
66749
67047
 
66750
- // Hide FormIO submit button component and wizard buttons in readOnly mode
66751
- if (mode == "readOnly") {
66752
- const submitComponents = document.querySelectorAll(
66753
- ".formio-component-submit"
66754
- );
66755
- submitComponents.forEach((component) => {
66756
- component.style.display = "none";
66757
- });
67048
+ formObj.submission = {
67049
+ data:
67050
+ typeof formPreviousData === "string"
67051
+ ? JSON.parse(formPreviousData)
67052
+ : formPreviousData,
67053
+ };
66758
67054
 
66759
- // Hide wizard navigation buttons
66760
- const wizardNextBtns = document.querySelectorAll(
66761
- ".btn-wizard-nav-next"
66762
- );
66763
- wizardNextBtns.forEach((btn) => {
66764
- btn.style.display = "none";
67055
+ console.log("[FormIO] \u2705 Previous submission data applied");
67056
+ } else {
67057
+ console.log("[FormIO] \u2139\uFE0F No previous form data found");
67058
+ }
67059
+
67060
+ // Calculate initial progress immediately
67061
+ console.log("[FormIO] \u{1F4CA} Calculating initial progress...");
67062
+ executeProgressCalculation(privateExternal, permission);
67063
+ console.log("[FormIO] \u2705 Progress calculation completed");
67064
+
67065
+ // Hide FormIO submit button component and wizard buttons in readOnly mode
67066
+ if (mode == "readOnly") {
67067
+ console.log("[FormIO] \u{1F512} ReadOnly mode detected");
67068
+
67069
+ const submitComponents = document.querySelectorAll(
67070
+ ".formio-component-submit"
67071
+ );
67072
+ console.log(
67073
+ \`[FormIO] Found \${submitComponents.length} submit components\`
67074
+ );
67075
+
67076
+ submitComponents.forEach((component, index) => {
67077
+ component.style.display = "none";
67078
+ console.log(\`[FormIO] Hidden submit component \${index + 1}\`);
67079
+ });
67080
+
67081
+ const wizardNextBtns = document.querySelectorAll(
67082
+ ".btn-wizard-nav-next"
67083
+ );
67084
+ console.log(
67085
+ \`[FormIO] Found \${wizardNextBtns.length} wizard next buttons\`
67086
+ );
67087
+
67088
+ wizardNextBtns.forEach((btn, index) => {
67089
+ btn.style.display = "none";
67090
+ console.log(\`[FormIO] Hidden wizard next button \${index + 1}\`);
67091
+ });
67092
+
67093
+ const wizardSubmitBtns = document.querySelectorAll(
67094
+ ".btn-wizard-nav-submit"
67095
+ );
67096
+ console.log(
67097
+ \`[FormIO] Found \${wizardSubmitBtns.length} wizard submit buttons\`
67098
+ );
67099
+
67100
+ wizardSubmitBtns.forEach((btn, index) => {
67101
+ btn.style.display = "none";
67102
+ console.log(\`[FormIO] Hidden wizard submit button \${index + 1}\`);
67103
+ });
67104
+
67105
+ const wizardPrevBtns = document.querySelectorAll(
67106
+ ".btn-wizard-nav-previous"
67107
+ );
67108
+ console.log(
67109
+ \`[FormIO] Found \${wizardPrevBtns.length} wizard previous buttons\`
67110
+ );
67111
+
67112
+ wizardPrevBtns.forEach((btn, index) => {
67113
+ btn.style.display = "none";
67114
+ console.log(\`[FormIO] Hidden wizard previous button \${index + 1}\`);
67115
+ });
67116
+ } else {
67117
+ console.log("[FormIO] \u{1F513} Editable mode detected");
67118
+ }
67119
+
67120
+ console.log("[FormIO] \u{1F4E1} Sending FORM_RENDER callback...");
67121
+ sendEventCallback({
67122
+ type: FORM_EVENTS.FORM_RENDER,
67123
+ message: "Success: Form rendered successfully.",
67124
+ data: {
67125
+ submissionData: formPreviousData,
67126
+ formTemplate: template,
67127
+ },
66765
67128
  });
67129
+ console.log("[FormIO] \u2705 FORM_RENDER callback sent");
67130
+
67131
+ // Hide SDK loader
67132
+ const sdkLoader = document.getElementById("sdk-form-loader");
67133
+
67134
+ if (sdkLoader) {
67135
+ console.log("[FormIO] \u23F3 Loader found, hiding...");
67136
+ sdkLoader.classList.add("hidden");
67137
+ console.log("[FormIO] \u2705 Loader hidden");
67138
+ } else {
67139
+ console.log("[FormIO] \u26A0\uFE0F Loader element not found");
67140
+ }
67141
+
67142
+ // Dispatch custom event
67143
+ console.log("[FormIO] \u{1F4E2} Dispatching FormRenderingComplete event...");
66766
67144
 
66767
- const wizardSubmitBtns = document.querySelectorAll(
66768
- ".btn-wizard-nav-submit"
67145
+ document.dispatchEvent(
67146
+ new CustomEvent("FormRenderingComplete", {
67147
+ detail: {
67148
+ timestamp: new Date().toISOString(),
67149
+ status: "success",
67150
+ },
67151
+ })
66769
67152
  );
66770
- wizardSubmitBtns.forEach((btn) => {
66771
- btn.style.display = "none";
66772
- });
66773
67153
 
66774
- const wizardPrevBtns = document.querySelectorAll(
66775
- ".btn-wizard-nav-previous"
67154
+ console.log(
67155
+ "[FormIO] \u2705 FormRenderingComplete event dispatched successfully"
66776
67156
  );
66777
- wizardPrevBtns.forEach((btn) => {
66778
- btn.style.display = "none";
66779
- });
66780
- }
66781
67157
 
66782
- sendEventCallback({
66783
- type: FORM_EVENTS.FORM_RENDER,
66784
- message: "Success: Form rendered successfully.",
66785
- data: { submissionData: formPreviousData, formTemplate: template },
67158
+ // File input
67159
+ const fileInput = document.querySelector('input[type="file"]');
67160
+
67161
+ if (fileInput) {
67162
+ fileInput.setAttribute("accept", "*/*");
67163
+ console.log("[FormIO] \u{1F4CE} File input found, accept=*/* applied");
67164
+ } else {
67165
+ console.log("[FormIO] \u2139\uFE0F No file input found");
67166
+ }
67167
+
67168
+ console.log("[FormIO] \u{1F389} Full formReady process completed");
67169
+ })
67170
+ .catch((error) => {
67171
+ console.error("[FormIO] \u274C formReady.then() failed:", error);
66786
67172
  });
66787
- console.log("[FormIO] \u2705 Form rendered successfully \u2014 SDK handover complete");
66788
67173
 
66789
- // Hide SDK loader when form is ready
66790
- const sdkLoader = document.getElementById('sdk-form-loader');
66791
- if (sdkLoader) {
66792
- sdkLoader.classList.add('hidden');
66793
- }
66794
67174
 
66795
- // mark rendered; LessRenderingComplete will also set readiness when styling finishes
66796
67175
 
66797
- document.dispatchEvent(new CustomEvent("FormRenderingComplete"));
66798
- const fileInput = document.querySelector('input[type="file"]');
66799
- if (fileInput) fileInput.setAttribute("accept", "*/*");
66800
- });
66801
67176
  } catch (error) {
66802
67177
  console.error("\u274C Error creating form (after retries):", error);
66803
67178
 
@@ -67925,7 +68300,7 @@ window.deleteAppDocument = async function(id) {
67925
68300
  window.getAllDocuments = getAllDocuments;
67926
68301
  window.hasDocuments = hasDocuments;
67927
68302
  function getBuildVersion() {
67928
- return "1.0.20";
68303
+ return "1.0.22";
67929
68304
  }
67930
68305
  export {
67931
68306
  getBuildVersion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unvired/turboforms-embed-sdk",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "Reusable vanilla JS form library that works with React, Angular, Ionic, etc.",
5
5
  "main": "dist/unvired-forms-sdk.js",
6
6
  "types": "dist/index.d.ts",