unpoly-rails 3.0.0.rc4 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@
5
5
  /***/ (() => {
6
6
 
7
7
  window.up = {
8
- version: '3.0.0-rc4'
8
+ version: '3.0.0'
9
9
  };
10
10
 
11
11
 
@@ -9604,19 +9604,14 @@ up.form = (function () {
9604
9604
  function disableContainer(container) {
9605
9605
  let focusedElement = document.activeElement;
9606
9606
  let focusFallback;
9607
- let mayLoseFocus = container.contains(focusedElement);
9608
- if (mayLoseFocus) {
9609
- let focusedGroup = findGroup(focusedElement);
9610
- if (container.contains(focusedGroup) || container === focusedElement) {
9611
- focusFallback = focusedGroup;
9612
- }
9613
- else {
9614
- focusFallback = container;
9607
+ let controls = [...findFields(container), ...findSubmitButtons(container)];
9608
+ for (let control of controls) {
9609
+ if (control === focusedElement) {
9610
+ focusFallback = findGroup(focusedElement);
9615
9611
  }
9612
+ raiseDisableStack(control);
9616
9613
  }
9617
- let controls = [...findFields(container), ...findSubmitButtons(container)];
9618
- controls.forEach(raiseDisableStack);
9619
- if (focusFallback && !focusFallback.contains(document.activeElement)) {
9614
+ if (focusFallback) {
9620
9615
  up.focus(focusFallback, { force: true, preventScroll: true });
9621
9616
  }
9622
9617
  return function () {