We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 574cca8 commit 0cebfbaCopy full SHA for 0cebfba
ui/packages/shared/components/src/hooks/URLState/utils.ts
@@ -73,10 +73,14 @@ export const sanitize = (
73
): Record<string, ParamValue> => {
74
const sanitized: Record<string, ParamValue> = {};
75
for (const [key, value] of Object.entries(params)) {
76
- if (isEmpty(value) || isEqual(value, defaultValues[key])) {
+ if (isEmpty(value) || isEqual(value, defaultValues[key]) || value == null) {
77
continue;
78
}
79
- sanitized[key] = value;
+ if (Array.isArray(value)) {
80
+ sanitized[key] = value.map(v => encodeURIComponent(v));
81
+ } else {
82
+ sanitized[key] = encodeURIComponent(value);
83
+ }
84
85
return sanitized;
86
};
0 commit comments