I recently turned on the new Global Search Experience for my model apps and found an interesting issue with PCF components that do not display the View Selector.
When the view selector is hidden utilizing the cds-data-set-option the Global Search Experience search box becomes the first focused item when you click on the Sitemap link displaying the PCF component. This causes the "recent searches" drop down to displays until the user click on another element on the page. This is very frustrating to user of the system since this happens every time they open this sub-area on the sitemap.
The cause of Issue is the displayViewSelector being set to false in the ControlManifest.Input.xml file. I have tried every combination of the displayCommandBar, displayViewSelector, and displayQuickFind being true/false and have discovered that this only happens when the displayViewSelector is set to false. Displaying any of the other elements does not fix the issue. During my testing I also removed all the code from my init and updateView functions to ensure none of my code was causing the problem.
<data-set name="dutyStatusDataSet" display-name-key="Dataset_Display_Key" cds-data-set-options="displayCommandBar:false;displayViewSelector:false;displayQuickFind:false">
Workaround:
Temporarily I am using a workaround to alleviate this issue. I set the displayViewSelector to true and then manually hide it using the following code which i run during the init function within the index.ts. This works and the timing is fast enough that the user does not see the view selector.
let viewSelector = document.querySelector("div[data-id='data-set-body-container']")?.parentElement?.previousSibling;
if (viewSelector)
{
(viewSelector as HTMLDivElement).style.display = 'none';
}
I believe this is a more general issue with the new search experience - with a fix being worked on. The behaviour happens for the 1st party functionality as well in some places.
WarrenBelz
87
Most Valuable Professional
mmbr1606
71
Super User 2025 Season 1
Michael E. Gernaey
65
Super User 2025 Season 1