Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-83507

e.preventDefault attached to body on click when forcing fullscreen (Boost)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • None
    • 4.3.5
    • Activity completion
    • None
    • MOODLE_403_STABLE

      We are using the following snippet to force a user to fullscreen:

      if (!self.isInFullscreenMode()) {
         const docelem = window.document.documentElement;
         if (docelem.webkitRequestFullscreen) {
             await docelem.webkitRequestFullscreen();
         } else if (docelem.mozRequestFullScreen) {
            await docelem.mozRequestFullScreen();
         } else if (docelem.requestFullscreen) {
            await docelem.requestFullscreen();
         }
      }

      However, it looks like the following code is getting attached to window.document.documentElement after we go fullscreen.

      /**
       * Add a backdrop to the page.
       *
       * @returns {Promise} rendering of modal backdrop.
       * @private
       */
      const getBackdrop = () => {
          if (!backdropPromise) {
              backdropPromise = Templates.render('core/modal_backdrop', {})
              .then(html => new ModalBackdrop(html))
              .then(modalBackdrop => {
                  const drawerZindex = getDrawerZIndex();
                  if (drawerZindex) {
                      modalBackdrop.setZIndex(getDrawerZIndex() - 1);
                  }
                  modalBackdrop.getAttachmentPoint().get(0).addEventListener('click', e => {
                      e.preventDefault();
                      Drawers.closeAllDrawers();
                  });
                  return modalBackdrop;
              })
              .catch();
          }
          return backdropPromise;
      };

      Focus is left on the last drawer tab and all other click events are stopped.

      I don't believe this is the intended behaviour behaviour.

        1. screenshot-1.png
          247 kB
          Mikel Martín Corrales

            Unassigned Unassigned
            bernardlechler Bernard Lechler
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.