@tensor_1/react 2.26.0 → 2.26.2

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.
@@ -757,18 +757,19 @@ function RichTextEditor(props) {
757
757
  ) }) : null,
758
758
  trailing.length ? /* @__PURE__ */ jsx("div", { className: "uix-rich-text__group uix-rich-text__group--end", role: "group", children: trailing.map(renderTool) }) : null,
759
759
  has("link") ? /* @__PURE__ */ jsx(Popover, { id: linkPopoverId, anchor: linkButtonRef, className: "uix-rich-text__link", role: "dialog", "aria-label": labels.link, children: /* @__PURE__ */ jsxs(
760
- "form",
760
+ "div",
761
761
  {
762
762
  className: "uix-rich-text__link-form",
763
- onSubmit: (event) => {
764
- event.preventDefault();
765
- applyLink();
766
- },
767
763
  onKeyDown: (event) => {
768
764
  if (event.key === "Escape") {
769
765
  event.preventDefault();
770
766
  closeLink();
771
767
  }
768
+ if (event.nativeEvent.isComposing || event.keyCode === 229) return;
769
+ if (event.key === "Enter" && event.target === linkInputRef.current) {
770
+ event.preventDefault();
771
+ applyLink();
772
+ }
772
773
  },
773
774
  children: [
774
775
  /* @__PURE__ */ jsxs("div", { className: "uix-field", children: [
@@ -806,7 +807,7 @@ function RichTextEditor(props) {
806
807
  children: labels.linkRemove
807
808
  }
808
809
  ) : null,
809
- /* @__PURE__ */ jsx("button", { type: "submit", className: "uix-btn uix-btn--primary uix-btn--sm", children: labels.linkApply })
810
+ /* @__PURE__ */ jsx("button", { type: "button", className: "uix-btn uix-btn--primary uix-btn--sm", onClick: applyLink, children: labels.linkApply })
810
811
  ] })
811
812
  ]
812
813
  }
@@ -44,6 +44,7 @@ function useDialog(open, onClose) {
44
44
  lockBodyScroll();
45
45
  let locked = true;
46
46
  const handleClose = () => {
47
+ if (el.open) return;
47
48
  if (locked) {
48
49
  locked = false;
49
50
  unlockBodyScroll();
package/dist/index.cjs CHANGED
@@ -294,6 +294,7 @@ function useDialog(open, onClose) {
294
294
  lockBodyScroll();
295
295
  let locked = true;
296
296
  const handleClose = () => {
297
+ if (el.open) return;
297
298
  if (locked) {
298
299
  locked = false;
299
300
  unlockBodyScroll();
@@ -2372,18 +2372,19 @@ function RichTextEditor(props) {
2372
2372
  ) }) : null,
2373
2373
  trailing.length ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "uix-rich-text__group uix-rich-text__group--end", role: "group", children: trailing.map(renderTool) }) : null,
2374
2374
  has("link") ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Popover, { id: linkPopoverId, anchor: linkButtonRef, className: "uix-rich-text__link", role: "dialog", "aria-label": labels.link, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2375
- "form",
2375
+ "div",
2376
2376
  {
2377
2377
  className: "uix-rich-text__link-form",
2378
- onSubmit: (event) => {
2379
- event.preventDefault();
2380
- applyLink();
2381
- },
2382
2378
  onKeyDown: (event) => {
2383
2379
  if (event.key === "Escape") {
2384
2380
  event.preventDefault();
2385
2381
  closeLink();
2386
2382
  }
2383
+ if (event.nativeEvent.isComposing || event.keyCode === 229) return;
2384
+ if (event.key === "Enter" && event.target === linkInputRef.current) {
2385
+ event.preventDefault();
2386
+ applyLink();
2387
+ }
2387
2388
  },
2388
2389
  children: [
2389
2390
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "uix-field", children: [
@@ -2421,7 +2422,7 @@ function RichTextEditor(props) {
2421
2422
  children: labels.linkRemove
2422
2423
  }
2423
2424
  ) : null,
2424
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "submit", className: "uix-btn uix-btn--primary uix-btn--sm", children: labels.linkApply })
2425
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "uix-btn uix-btn--primary uix-btn--sm", onClick: applyLink, children: labels.linkApply })
2425
2426
  ] })
2426
2427
  ]
2427
2428
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tensor_1/react",
3
- "version": "2.26.0",
3
+ "version": "2.26.2",
4
4
  "description": "Thin React wrappers over the UIx v2 CSS component library.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",