From a2e9c9a2cc5474c29b465c044ae449be9ff35b5c Mon Sep 17 00:00:00 2001 From: Niek Candaele Date: Sun, 5 Jan 2025 11:45:26 +0100 Subject: [PATCH 1/2] debug: add logging to select to try and debug --- .../inputs/selects/SelectQueryField/Generic/index.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/lib-components/src/components/inputs/selects/SelectQueryField/Generic/index.tsx b/packages/lib-components/src/components/inputs/selects/SelectQueryField/Generic/index.tsx index 243d5ef82..428609846 100644 --- a/packages/lib-components/src/components/inputs/selects/SelectQueryField/Generic/index.tsx +++ b/packages/lib-components/src/components/inputs/selects/SelectQueryField/Generic/index.tsx @@ -201,6 +201,12 @@ export const GenericSelectQueryField = forwardRef { const hasProps = options && options[0].props; const hasOptions = hasProps && Children.count(options[0].props.children) > 1; + console.log('options', options); + console.log('hasOptions', hasOptions); + console.log('hasProps', hasProps); + console.log('options[0].props', options[0].props); + console.log('Children.count(options[0].props.children)', Children.count(options[0].props.children)); + console.log('options[0].props.children', options[0].props.children); // initialFocus=-1 is used to prevent the first item from being focused when the list opens return ( From 10020dd0f23f93e8ed47be415dd82b73733d241f Mon Sep 17 00:00:00 2001 From: Niek Candaele Date: Sun, 5 Jan 2025 12:31:17 +0100 Subject: [PATCH 2/2] fix: gameserver select failing when domain does not have a gameserver of each type --- .../inputs/selects/SelectQueryField/Generic/index.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/lib-components/src/components/inputs/selects/SelectQueryField/Generic/index.tsx b/packages/lib-components/src/components/inputs/selects/SelectQueryField/Generic/index.tsx index 428609846..02c6a7d7d 100644 --- a/packages/lib-components/src/components/inputs/selects/SelectQueryField/Generic/index.tsx +++ b/packages/lib-components/src/components/inputs/selects/SelectQueryField/Generic/index.tsx @@ -201,12 +201,6 @@ export const GenericSelectQueryField = forwardRef { const hasProps = options && options[0].props; const hasOptions = hasProps && Children.count(options[0].props.children) > 1; - console.log('options', options); - console.log('hasOptions', hasOptions); - console.log('hasProps', hasProps); - console.log('options[0].props', options[0].props); - console.log('Children.count(options[0].props.children)', Children.count(options[0].props.children)); - console.log('options[0].props.children', options[0].props.children); // initialFocus=-1 is used to prevent the first item from being focused when the list opens return ( @@ -284,7 +278,7 @@ export const GenericSelectQueryField = forwardRef ), - ) ?? []), + )?.filter(Boolean) ?? []), ]; }, [children]);