@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.
package/dst/index.js CHANGED
@@ -2067,16 +2067,16 @@ var Layout = function Layout(_ref) {
2067
2067
  React.useEffect(function () {
2068
2068
  if (!theme) return;
2069
2069
 
2070
- var handler = function handler() {
2071
- if (settings != null && settings.value && settings != null && settings.onClick) {
2070
+ var handler = function handler(e) {
2071
+ if (e.matches && settings != null && settings.value && settings != null && settings.onClick) {
2072
2072
  settings == null ? void 0 : settings.onClick();
2073
2073
  }
2074
2074
  };
2075
2075
 
2076
- var query = window.matchMedia("(max-width: " + theme.breakpoints[1] + ")");
2077
- query.addListener(handler);
2076
+ var query = window.matchMedia("(min-width: " + theme.breakpoints[1] + ")");
2077
+ query.onchange = handler;
2078
2078
  return function () {
2079
- query.removeListener(handler);
2079
+ query.onchange = null;
2080
2080
  };
2081
2081
  }, [theme, settings == null ? void 0 : settings.value, settings == null ? void 0 : settings.onClick]);
2082
2082
  var menuItems = [/*#__PURE__*/React__default['default'].createElement(Dimmer, {