Skip to content

Commit 683ae84

Browse files
committed
Add documentation for quotePath prop and re-quoting logic
1 parent ebb9600 commit 683ae84

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

ui/v2.5/src/components/Shared/FolderSelect/FolderSelect.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ interface IProps {
1515
defaultDirectories?: string[];
1616
appendButton?: JSX.Element;
1717
collapsible?: boolean;
18+
/** Re-wrap stripped path in quotes if it contains spaces (needed by PathFilter) */
1819
quotePath?: boolean;
1920
hideError?: boolean;
2021
}
@@ -40,7 +41,7 @@ const _FolderSelect: React.FC<IProps> = ({
4041
const normalizedPath = TextUtils.stripQuotes(path);
4142
const { directories, parent, error, loading } = useDirectoryPaths(
4243
normalizedPath,
43-
hideError
44+
hideError,
4445
);
4546

4647
const selectableDirectories =
@@ -50,6 +51,7 @@ const _FolderSelect: React.FC<IProps> = ({
5051

5152
function setInstant(value: string) {
5253
const stripped = TextUtils.stripQuotes(value);
54+
// re-quote if backend expects it (PathFilter); otherwise keep stripped
5355
const normalizedValue =
5456
quotePath && stripped.includes(" ")
5557
? TextUtils.addQuotes(stripped)

0 commit comments

Comments
 (0)