diff --git a/l10n/messages.pot b/l10n/messages.pot index 40580f46cc..fb61015786 100644 --- a/l10n/messages.pot +++ b/l10n/messages.pot @@ -194,6 +194,10 @@ msgstr "" msgid "Load more \"{options}\"" msgstr "" +#. TRANSLATORS: The button is in a loading state +msgid "Loading …" +msgstr "" + #. TRANSLATORS: A color name for RGB(45, 115, 190) msgid "Mariner" msgstr "" diff --git a/src/components/NcDialog/NcDialog.vue b/src/components/NcDialog/NcDialog.vue index a14acdb76b..971b890c26 100644 --- a/src/components/NcDialog/NcDialog.vue +++ b/src/components/NcDialog/NcDialog.vue @@ -106,7 +106,6 @@ Note that this is not possible if the dialog contains a navigation! ``` + +### Loading buttons +Sometimes a dialog ends with a request and this request might fail due to server-side-validation. +In this case it is often desired to keep the dialog open, this can be done by returning `false` from the button callback, +to not block this callback should return a `Promise`. + +While the promise is awaited the button will have a loading state, +this means, as long as no custom `icon`-slot is used, a loading icon will be shown. +Please note that the **button will not be disabled or accessibility reasons**, +because disabled elements cannot be focused and so the loading state could not be communicated e.g. via screen readers. + +```vue + + +```