@bpmn-io/properties-panel 3.40.2 → 3.40.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/dist/index.js CHANGED
@@ -816,12 +816,17 @@ function useStickyIntersectionObserver(ref, scrollContainerSelector, setSticky)
816
816
  * The `callback` reference is static and can be safely used in external
817
817
  * libraries or as a prop that does not cause rerendering of children.
818
818
  *
819
+ * The ref update is deferred to useLayoutEffect to prevent stale-closure
820
+ * bugs when Chrome fires blur on elements removed during re-render.
821
+ *
819
822
  * @param {Function} callback function with changing reference
820
823
  * @returns {Function} static function reference
821
824
  */
822
825
  function useStaticCallback(callback) {
823
826
  const callbackRef = hooks.useRef(callback);
824
- callbackRef.current = callback;
827
+ hooks.useLayoutEffect(() => {
828
+ callbackRef.current = callback;
829
+ });
825
830
  return hooks.useCallback((...args) => callbackRef.current(...args), []);
826
831
  }
827
832
 
@@ -2264,7 +2269,7 @@ function ToggleSwitchEntry(props) {
2264
2269
  inline: inline,
2265
2270
  tooltip: tooltip,
2266
2271
  element: element
2267
- }), jsxRuntime.jsx(Description, {
2272
+ }, element), jsxRuntime.jsx(Description, {
2268
2273
  forId: id,
2269
2274
  element: element,
2270
2275
  value: description
@@ -2555,7 +2560,7 @@ function FeelTextfield(props) {
2555
2560
  };
2556
2561
  const handleOnKeyDown = e => {
2557
2562
  if (isCmdWithChar(e)) {
2558
- handleInput.flush();
2563
+ handleInput.flush?.();
2559
2564
  }
2560
2565
  };
2561
2566
  const handleLint = useStaticCallback((lint = []) => {
@@ -3902,7 +3907,7 @@ function TextArea(props) {
3902
3907
  };
3903
3908
  const handleOnKeyDown = e => {
3904
3909
  if (isCmdWithChar(e)) {
3905
- handleInput.flush();
3910
+ handleInput.flush?.();
3906
3911
  }
3907
3912
  };
3908
3913
  hooks.useLayoutEffect(() => {
@@ -4118,7 +4123,7 @@ function Textfield(props) {
4118
4123
  }, [value]);
4119
4124
  const handleOnKeyDown = e => {
4120
4125
  if (isCmdWithChar(e)) {
4121
- handleInput.flush();
4126
+ handleInput.flush?.();
4122
4127
  }
4123
4128
  };
4124
4129
  return jsxRuntime.jsxs("div", {