@royaloperahouse/chord 1.20.0 → 1.20.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## [1.20.1]
2
+ - Reset the select component's selected value to the first option if options change
3
+
1
4
  ## [1.20.0]
2
5
  - Tickbox: Add black-on-white option
3
6
  ## [1.19.0]
@@ -7747,6 +7747,14 @@ function Select(_ref3) {
7747
7747
  document.removeEventListener('click', closeSelectOnBlur, false);
7748
7748
  };
7749
7749
  }, []);
7750
+ React.useEffect(function () {
7751
+ if (options.length === 0) {
7752
+ setSelectedValue(null);
7753
+ return;
7754
+ }
7755
+
7756
+ setSelectedValue(options[0]);
7757
+ }, [options]);
7750
7758
  return /*#__PURE__*/React__default.createElement(Wrapper$3, null, label !== '' && /*#__PURE__*/React__default.createElement(BodyText, {
7751
7759
  level: 1,
7752
7760
  tag: "p",