Place the search / Page signals for themes
Page signals for themes
Once a shopper has used the search, the page says how many answer tabs are open, so your theme can react.
What the page tells you#
Each search opens an answer tab, like a browser tab. PXL Search publishes how many are open, in two ways, so your theme can react, for example by hiding its own hint while answers are showing:
- The attribute
data-pxl-search-tabson the<html>element holds the number of open tabs. - The event
pxl-search:tabsfires onwindoweach time it changes. Itsdetailis that number.
/* set on <html> */ html[data-pxl-search-tabs="0"] .my-hint { display: block; } // fired on window, detail = number of open tabs window.addEventListener("pxl-search:tabs", e => console.log(e.detail));
Typing examples stop#
The example searches that type themselves into a search bar or a marked field stop while answer tabs are open. See The navbar field.
Was this page helpful?