Process UX feedback for DownloadDialog (#942)
This commit is contained in:
parent
be0506653d
commit
25376c75fd
1 changed files with 6 additions and 4 deletions
|
@ -12,7 +12,7 @@ import {
|
|||
TextArea,
|
||||
} from "@patternfly/react-core";
|
||||
import FileSaver from "file-saver";
|
||||
import React, { useMemo, useState } from "react";
|
||||
import React, { useEffect, useMemo, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useAdminClient, useFetch } from "../../context/auth/AdminClient";
|
||||
import { useServerInfo } from "../../context/server-info/ServerInfoProvider";
|
||||
|
@ -65,6 +65,10 @@ export const DownloadDialog = ({
|
|||
(snippet) => setSnippet(snippet),
|
||||
[id, selected]
|
||||
);
|
||||
|
||||
// Clear snippet when selected config changes, this prevents old snippets from being displayed during fetch.
|
||||
useEffect(() => setSnippet(""), [id, selected]);
|
||||
|
||||
return (
|
||||
<ConfirmDialogModal
|
||||
titleKey={t("clients:downloadAdaptorTitle")}
|
||||
|
@ -113,9 +117,7 @@ export const DownloadDialog = ({
|
|||
<Select
|
||||
toggleId="type"
|
||||
isOpen={openType}
|
||||
onToggle={() => {
|
||||
setOpenType(!openType);
|
||||
}}
|
||||
onToggle={(isExpanded) => setOpenType(isExpanded)}
|
||||
variant={SelectVariant.single}
|
||||
value={selected}
|
||||
selections={selected}
|
||||
|
|
Loading…
Reference in a new issue