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

Confirm dialog default width does not work well on mobile

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.6
    • Fix Version/s: FRONTEND
    • Component/s: JavaScript
    • Labels:
    • Affected Branches:
      MOODLE_26_STABLE

      Description

      The default width for Moodle notification dialoguss is 400px, even on screens that are narrower than 400px. (Mobile phones have screens narrower than 400px, in portrait mode.)

      You can fix this in code that is providing the dialogue, such as the following, which looks pretty good:

              // Due to current Moodle limitation, the default size is incorrect n
              // devices with small screens.
              var winWidth = Y.one('body').get('winWidth');
              if (winWidth < 450) {
                  config.width = winWidth - 50;
              }
              var dialog = new M.core.confirm(config);
      

      I think it might be preferable if this behaviour were default - i.e. if no width is specified then rather than defaulting to 400, it should use (400px or 50px less than width of window, whichever is smaller).

      I'll stick a patch up for this. Not sure if it is a bug or improvement... The code is different for master/2.6 vs. 2.5 because stuff got moved around, so I'll just code it for master atm.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                quen Sam Marshall
                Participants:
                Component watchers:
                Jake Dallimore, Jun Pataleta
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: