Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fix page selector custom values

Adityade7c06c0a501
diff --git a/src/components/input/WebsiteValueComboBox.test.tsx b/src/components/input/WebsiteValueComboBox.test.tsx
index 0dd6cf51d..1b1927864 100644
--- a/src/components/input/WebsiteValueComboBox.test.tsx
+++ b/src/components/input/WebsiteValueComboBox.test.tsx
@@ -65,7 +65,7 @@ test('clears the selected website value when the input is cleared', () => {
expect(onChange).toHaveBeenCalledWith('');
});
-test('combines values from both Journey step types', () => {
+test('combines values from both Journey step types with the typed value', () => {
render(
<WebsiteValueComboBox
label="Start step"
@@ -74,11 +74,12 @@ test('combines values from both Journey step types', () => {
additionalType="event"
startDate={new Date('2026-08-01')}
endDate={new Date('2026-08-03')}
- value=""
+ value="/"
onChange={() => {}}
/>,
);
+ expect(screen.getByText('/')).toBeInTheDocument();
expect(screen.getByText('/home')).toBeInTheDocument();
expect(screen.getByText('signup')).toBeInTheDocument();
});
diff --git a/src/components/input/WebsiteValueComboBox.tsx b/src/components/input/WebsiteValueComboBox.tsx
index fc9b5120a..6c8b56baf 100644
--- a/src/components/input/WebsiteValueComboBox.tsx
+++ b/src/components/input/WebsiteValueComboBox.tsx
@@ -56,12 +56,14 @@ export function WebsiteValueComboBox({
}, [type, additionalType]);
const items = useMemo(() => {
- const values = [...(primaryQuery.data || []), ...(additionalQuery.data || [])]
- .map(({ value }) => value)
- .filter(Boolean);
+ const values = [
+ value,
+ ...(primaryQuery.data || []).map(({ value }) => value),
+ ...(additionalQuery.data || []).map(({ value }) => value),
+ ].filter(Boolean);
return [...new Set<string>(values)];
- }, [primaryQuery.data, additionalQuery.data]);
+ }, [value, primaryQuery.data, additionalQuery.data]);
return (
<div className={cn('flex flex-col gap-1', className)}>