<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic SelectV2 component error when typing on component in Developer Q&amp;A Forum</title>
    <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/SelectV2-component-error-when-typing-on-component/m-p/239046#M822</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to upgrade my Select component to SelectV2 component.&lt;/P&gt;&lt;P&gt;I am facing an issue that:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;when I click on "Search..." and start typing, it is working fine&lt;/LI&gt;&lt;LI&gt;when I only click to see all options and then start typing without click on "Search...", the following error is shown:&lt;/LI&gt;&lt;/OL&gt;&lt;LI-CODE lang="markup"&gt;Error: Failed to execute 'querySelector' on 'Element': '#51a9b590-7d6a-402c-84c6-2d435127657a' is not a valid selector.
    at onKeyDown (http://localhost:3000/ui/main.js:70380:18)
    at Select3._this.onKeyDown (http://localhost:3000/ui/main.js:68638:11)
    at HTMLUnknownElement.callCallback2 (http://localhost:3000/ui/main.js:5639:24)
    at Object.invokeGuardedCallbackDev (http://localhost:3000/ui/main.js:5664:26)
    at invokeGuardedCallback (http://localhost:3000/ui/main.js:5698:41)
    at invokeGuardedCallbackAndCatchFirstError (http://localhost:3000/ui/main.js:5701:35)
    at executeDispatch (http://localhost:3000/ui/main.js:8483:13)
    at processDispatchQueueItemsInOrder (http://localhost:3000/ui/main.js:8503:17)
    at processDispatchQueue (http://localhost:3000/ui/main.js:8512:15)
    at dispatchEventsForPlugins (http://localhost:3000/ui/main.js:8520:13)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dependencies:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"@dynatrace/strato-components-preview"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"0.111.3"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 05 Mar 2024 20:41:09 GMT</pubDate>
    <dc:creator>StephenLHChan</dc:creator>
    <dc:date>2024-03-05T20:41:09Z</dc:date>
    <item>
      <title>SelectV2 component error when typing on component</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/SelectV2-component-error-when-typing-on-component/m-p/239046#M822</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to upgrade my Select component to SelectV2 component.&lt;/P&gt;&lt;P&gt;I am facing an issue that:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;when I click on "Search..." and start typing, it is working fine&lt;/LI&gt;&lt;LI&gt;when I only click to see all options and then start typing without click on "Search...", the following error is shown:&lt;/LI&gt;&lt;/OL&gt;&lt;LI-CODE lang="markup"&gt;Error: Failed to execute 'querySelector' on 'Element': '#51a9b590-7d6a-402c-84c6-2d435127657a' is not a valid selector.
    at onKeyDown (http://localhost:3000/ui/main.js:70380:18)
    at Select3._this.onKeyDown (http://localhost:3000/ui/main.js:68638:11)
    at HTMLUnknownElement.callCallback2 (http://localhost:3000/ui/main.js:5639:24)
    at Object.invokeGuardedCallbackDev (http://localhost:3000/ui/main.js:5664:26)
    at invokeGuardedCallback (http://localhost:3000/ui/main.js:5698:41)
    at invokeGuardedCallbackAndCatchFirstError (http://localhost:3000/ui/main.js:5701:35)
    at executeDispatch (http://localhost:3000/ui/main.js:8483:13)
    at processDispatchQueueItemsInOrder (http://localhost:3000/ui/main.js:8503:17)
    at processDispatchQueue (http://localhost:3000/ui/main.js:8512:15)
    at dispatchEventsForPlugins (http://localhost:3000/ui/main.js:8520:13)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dependencies:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"@dynatrace/strato-components-preview"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"0.111.3"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 05 Mar 2024 20:41:09 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/SelectV2-component-error-when-typing-on-component/m-p/239046#M822</guid>
      <dc:creator>StephenLHChan</dc:creator>
      <dc:date>2024-03-05T20:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: SelectV2 component error when typing on component</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/SelectV2-component-error-when-typing-on-component/m-p/239102#M823</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/59527"&gt;@StephenLHChan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately I can't reproduce the behavior with&amp;nbsp;&lt;SPAN&gt;"@dynatrace/strato-components-preview"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"0.111.3".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Maybe this issue only happens when certain props are being used? I have tried various combinations, but could not reproduce the behavior. Here my latest reproducer snippet&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;  const result = useDqlQuery({
    body: {
      query: `fetch dt.entity.process_group
        | dedup entity.name
        | fields name = entity.name, id`,
      requestTimeoutMilliseconds: 30000
    }
  });
  const [singleValue, setSingleValue] = useState&amp;lt;string | null&amp;gt;(null);


  return (
    &amp;lt;Flex flexDirection="column" padding={32}&amp;gt;
      &amp;lt;FormField label="Select a country"&amp;gt;
        &amp;lt;SelectV2
          value={singleValue}
          onChange={setSingleValue}
          
        &amp;gt;
          &amp;lt;SelectV2.Trigger width="550px" /&amp;gt;
          &amp;lt;SelectV2.Content &amp;gt;
            &amp;lt;SelectV2.EmptyState&amp;gt;
              No matching countries found.
            &amp;lt;/SelectV2.EmptyState&amp;gt;
            &amp;lt;SelectV2.Filter /&amp;gt;
            {
              result.data &amp;amp;&amp;amp; result.data.records.map((record) =&amp;gt; (
                &amp;lt;SelectV2.Option key={record!.id} value={record!.id}&amp;gt;{record!.name}&amp;lt;/SelectV2.Option&amp;gt;
              ))
            }
          &amp;lt;/SelectV2.Content&amp;gt;
        &amp;lt;/SelectV2&amp;gt;
      &amp;lt;/FormField&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you maybe share you snippet how you use the SelectV2 component or let us know which properties are being used?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;Sini&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 14:07:25 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/SelectV2-component-error-when-typing-on-component/m-p/239102#M823</guid>
      <dc:creator>sinisa_zubic</dc:creator>
      <dc:date>2024-03-06T14:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: SelectV2 component error when typing on component</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/SelectV2-component-error-when-typing-on-component/m-p/239110#M824</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/38283"&gt;@sinisa_zubic&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for the reply. Here is the code snippet of the SelectV2 part.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;SelectV2
	value={selectedIds}
	clearable
	multiple={multipleEntitySelection}
	disabled={
		!env ||
		!type ||
		isLoading ||
		entitySuggestions.length === 0 ||
		disabled
	}
	onChange={(val) =&amp;gt; { some OnChange Action
	}}
&amp;gt;
	&amp;lt;SelectV2.Trigger
		placeholder={
			isLoading ? 'Loading...' : entitySelectionPlaceholder
		}
		width="full"
	&amp;gt;
		&amp;lt;SelectV2.DisplayValue&amp;gt;
			&amp;lt;Flex&amp;gt;
				{selectedIds !== null &amp;amp;&amp;amp; selectedIds.length &amp;gt; 0 ? (
					typeof selectedIds === 'string' ? (
						&amp;lt;Text&amp;gt;Selected 1 {type}&amp;lt;/Text&amp;gt;
					) : (
						&amp;lt;Text&amp;gt;
							Selected {selectedIds.length} {type}
						&amp;lt;/Text&amp;gt;
					)
				) : (
					&amp;lt;Text&amp;gt;{entitySelectionPlaceholder}&amp;lt;/Text&amp;gt;
				)}
			&amp;lt;/Flex&amp;gt;
		&amp;lt;/SelectV2.DisplayValue&amp;gt;
	&amp;lt;/SelectV2.Trigger&amp;gt;
	&amp;lt;SelectV2.Content&amp;gt;
		&amp;lt;SelectV2.Filter /&amp;gt;
		{entitySuggestions
			?.sort((a, b) =&amp;gt; {
				if (selectedIds?.includes(a.entityId)) {
					return -1;
				}
				if (selectedIds?.includes(b.entityId)) {
					return 1;
				}
				if (a.displayName &amp;lt; b.displayName) {
					return -1;
				} else {
					return 1;
				}
			})
			.map(({ entityId, displayName }) =&amp;gt; {
				return (
					&amp;lt;SelectV2.Option
						key={entityId as string}
						value={entityId as string}
					&amp;gt;
						{displayName}
					&amp;lt;/SelectV2.Option&amp;gt;
				);
			})}
	&amp;lt;/SelectV2.Content&amp;gt;
&amp;lt;/SelectV2&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 06 Mar 2024 15:14:16 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/SelectV2-component-error-when-typing-on-component/m-p/239110#M824</guid>
      <dc:creator>StephenLHChan</dc:creator>
      <dc:date>2024-03-06T15:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: SelectV2 component error when typing on component</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/SelectV2-component-error-when-typing-on-component/m-p/239206#M826</link>
      <description>&lt;P&gt;I am still not able to reproduce the issue but currently the SelectV2 component does not auto focus on the search. So when clicking on the Component and start typing, the filtering won't start. It is intended behavior that you have to do two clicks. You can try it also out here in the reference:&amp;nbsp;&lt;A href="https://developer.dynatrace.com/reference/design-system/preview/forms/SelectV2/#filter-options" target="_blank" rel="noopener"&gt;https://developer.dynatrace.com/reference/design-system/preview/forms/SelectV2/#filter-options&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have also further checked with engineering and we will add the same behavior to SelectV2, so it won't be needed anymore that you make two clicks to start searching. But I can't give you any ETA on that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know if you have some other handlers in place which could trigger this error. Maybe you can create a reproducer (app) and share it with us?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 10:46:54 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/SelectV2-component-error-when-typing-on-component/m-p/239206#M826</guid>
      <dc:creator>sinisa_zubic</dc:creator>
      <dc:date>2024-03-07T10:46:54Z</dc:date>
    </item>
  </channel>
</rss>

