diff --git a/core/modules/outside_in/src/Ajax/OpenOffCanvasDialogCommand.php b/core/modules/outside_in/src/Ajax/OpenOffCanvasDialogCommand.php
index 9989d91f65..6296bb0352 100644
--- a/core/modules/outside_in/src/Ajax/OpenOffCanvasDialogCommand.php
+++ b/core/modules/outside_in/src/Ajax/OpenOffCanvasDialogCommand.php
@@ -12,6 +12,11 @@
 class OpenOffCanvasDialogCommand extends OpenDialogCommand {
 
   /**
+   * The dialog width to use if none is provided.
+   */
+  const DIALOG_WIDTH = 300;
+
+  /**
    * Constructs an OpenOffCanvasDialogCommand object.
    *
    * The off-canvas dialog differs from the normal modal provided by
@@ -42,6 +47,12 @@ public function __construct($title, $content, array $dialog_options = [], $setti
     // @todo drupal.ajax.js does not respect drupalAutoButtons properly, pass an
     //   empty set of buttons until https://www.drupal.org/node/2793343 is in.
     $this->dialogOptions['buttons'] = [];
+    // If no width option is provided then use the default width to avoid the
+    // dialog staying at the width of the previous instance when opened
+    // more than once, with different widths, on a single page.
+    if (!isset($this->dialogOptions['width'])) {
+      $this->dialogOptions['width'] = static::DIALOG_WIDTH;
+    }
   }
 
   /**
diff --git a/core/modules/outside_in/src/Tests/Ajax/OffCanvasDialogTest.php b/core/modules/outside_in/src/Tests/Ajax/OffCanvasDialogTest.php
index 41d66dde3f..e2b451e1a7 100644
--- a/core/modules/outside_in/src/Tests/Ajax/OffCanvasDialogTest.php
+++ b/core/modules/outside_in/src/Tests/Ajax/OffCanvasDialogTest.php
@@ -46,6 +46,7 @@ public function testDialog() {
           'draggable' => FALSE,
           'drupalAutoButtons' => FALSE,
           'buttons' => [],
+          'width' => 300,
         ],
       'effect' => 'fade',
       'speed' => 1000,
diff --git a/core/modules/outside_in/tests/src/Unit/Ajax/OpenOffCanvasDialogCommandTest.php b/core/modules/outside_in/tests/src/Unit/Ajax/OpenOffCanvasDialogCommandTest.php
index 92103b401a..d822415d61 100644
--- a/core/modules/outside_in/tests/src/Unit/Ajax/OpenOffCanvasDialogCommandTest.php
+++ b/core/modules/outside_in/tests/src/Unit/Ajax/OpenOffCanvasDialogCommandTest.php
@@ -31,6 +31,7 @@ public function testRender() {
         'draggable' => FALSE,
         'drupalAutoButtons' => FALSE,
         'buttons' => [],
+        'width' => 300,
       ],
       'effect' => 'fade',
       'speed' => 1000,
