Przeglądaj źródła

robodog: fix `form({ modal: true })` not enabling modal options (#1690)

* robodog: fix `form({ modal: true })` not enabling modal options

Previously, dashboard modal options like `closeAfterFinish` were not
available to robodog.form even if the `modal: true` option was set. this
was because the `addDashboardPlugin` function checks that `opts.inline
=== false`, and we were keeping it null/undefined.

* robodog: use the same `inline` check as the Dashboard does
Renée Kooi 5 lat temu
rodzic
commit
d0383fb229

+ 1 - 1
packages/@uppy/robodog/src/addDashboardPlugin.js

@@ -36,7 +36,7 @@ function addDashboardPlugin (uppy, opts, overrideOpts) {
   })
 
   const inline = overrideOpts.inline == null ? dashboardOpts.inline : overrideOpts.inline
-  if (inline === false) {
+  if (!inline) {
     modalDashboardOptionNames.forEach((key) => {
       if (opts.hasOwnProperty(key)) {
         dashboardOpts[key] = opts[key]

+ 1 - 0
packages/@uppy/robodog/src/form.js

@@ -65,6 +65,7 @@ function form (target, opts) {
       button.type = 'button'
       const old = findDOMElement(trigger, findDOMElement(target))
       old.parentNode.replaceChild(button, old)
+      dashboardOpts.inline = false
       dashboardOpts.trigger = button
     } else {
       dashboardOpts.inline = true