@abgov/react-components 6.8.0-alpha.4 → 6.9.0-alpha.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/index.js CHANGED
@@ -3820,7 +3820,8 @@ function GoabTextArea({
3820
3820
  ml,
3821
3821
  autoComplete,
3822
3822
  onChange,
3823
- onKeyPress
3823
+ onKeyPress,
3824
+ onBlur
3824
3825
  }) {
3825
3826
  const el = react.useRef(null);
3826
3827
  react.useEffect(() => {
@@ -3828,33 +3829,27 @@ function GoabTextArea({
3828
3829
  return;
3829
3830
  }
3830
3831
  const current = el.current;
3831
- const listener = (e) => {
3832
+ const changeListener = (e) => {
3832
3833
  const detail = e.detail;
3833
3834
  onChange == null ? void 0 : onChange(detail);
3834
3835
  };
3835
- if (onChange) {
3836
- current.addEventListener("_change", listener);
3837
- }
3838
- return () => {
3839
- if (onChange) {
3840
- current.removeEventListener("_change", listener);
3841
- }
3842
- };
3843
- }, [el, onChange]);
3844
- react.useEffect(() => {
3845
- if (!el.current) {
3846
- return;
3847
- }
3848
- const current = el.current;
3849
3836
  const keypressListener = (e) => {
3850
3837
  const detail = e.detail;
3851
3838
  onKeyPress == null ? void 0 : onKeyPress(detail);
3852
3839
  };
3840
+ const blurListener = (e) => {
3841
+ const detail = e.detail;
3842
+ onBlur == null ? void 0 : onBlur(detail);
3843
+ };
3844
+ current.addEventListener("_change", changeListener);
3853
3845
  current.addEventListener("_keyPress", keypressListener);
3846
+ current.addEventListener("_blur", blurListener);
3854
3847
  return () => {
3848
+ current.removeEventListener("_change", changeListener);
3855
3849
  current.removeEventListener("_keyPress", keypressListener);
3850
+ current.removeEventListener("_blur", blurListener);
3856
3851
  };
3857
- }, [el, onKeyPress]);
3852
+ }, [el, onChange, onKeyPress, onBlur]);
3858
3853
  return /* @__PURE__ */ jsxRuntime.jsx(
3859
3854
  "goa-textarea",
3860
3855
  {