@carbonplan/components 11.0.5-develop.2 → 11.0.5-develop.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2014,16 +2014,16 @@ const Layout = ({
2014
2014
  useEffect(() => {
2015
2015
  if (!theme) return;
2016
2016
 
2017
- const handler = () => {
2018
- if (settings != null && settings.value && settings != null && settings.onClick) {
2017
+ const handler = e => {
2018
+ if (e.matches && settings != null && settings.value && settings != null && settings.onClick) {
2019
2019
  settings == null ? void 0 : settings.onClick();
2020
2020
  }
2021
2021
  };
2022
2022
 
2023
- const query = window.matchMedia(`(max-width: ${theme.breakpoints[1]})`);
2024
- query.addListener(handler);
2023
+ const query = window.matchMedia(`(min-width: ${theme.breakpoints[1]})`);
2024
+ query.onchange = handler;
2025
2025
  return () => {
2026
- query.removeListener(handler);
2026
+ query.onchange = null;
2027
2027
  };
2028
2028
  }, [theme, settings == null ? void 0 : settings.value, settings == null ? void 0 : settings.onClick]);
2029
2029
  const menuItems = [/*#__PURE__*/React.createElement(Dimmer, {