@glimstone/react 5.0.3 → 5.0.4

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.
Files changed (2) hide show
  1. package/dist/FieldRow.js +3 -1
  2. package/package.json +2 -2
package/dist/FieldRow.js CHANGED
@@ -5,6 +5,8 @@ import { FieldRowContext, FieldRowGroupContext } from "./fieldName.js";
5
5
  import { InfoBubble } from "./InfoBubble.js";
6
6
  import { Pill } from "./Pill.js";
7
7
  export function FieldRow({ label, drawn, hint, value, tone, wide, children, className, onClick, ...rest }) {
8
+ // A control in the row may take the row away before its click bubbles up,
9
+ // which empties this ref, so the row's own click takes the row from the event.
8
10
  const row = useRef(null);
9
11
  const inGroup = useContext(FieldRowGroupContext);
10
12
  useEffect(() => watchRowStack(row.current), []);
@@ -12,6 +14,6 @@ export function FieldRow({ label, drawn, hint, value, tone, wide, children, clas
12
14
  (value !== undefined && (_jsx(Pill, { className: "glim-num", tone: tone, children: value })));
13
15
  return (_jsx(FieldRowContext.Provider, { value: label, children: _jsxs("div", { "data-glim": "FieldRow", "data-press": "", ...rest, ref: row, onClick: (e) => {
14
16
  onClick?.(e);
15
- pressRowSwitch(row.current, e.target);
17
+ pressRowSwitch(e.currentTarget, e.target);
16
18
  }, className: ["glim-field-row", wide && "glim-field-row--wide", className].filter(Boolean).join(" "), children: [_jsxs("span", { className: "glim-field-row-name", children: [_jsx("span", { className: "glim-field-row-label", onClick: () => pressRowControl(row.current), children: drawn ?? label }), hint && _jsx(InfoBubble, { tip: hint })] }), inGroup ? _jsx("span", { className: "glim-field-row-controls", children: control }) : control] }) }));
17
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glimstone/react",
3
- "version": "5.0.3",
3
+ "version": "5.0.4",
4
4
  "description": "GlimStone's components for React",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": { "type": "git", "url": "git+https://github.com/junkerderprovinz/glimstone.git", "directory": "packages/react" },
@@ -16,7 +16,7 @@
16
16
  "build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.build.json"
17
17
  },
18
18
  "dependencies": {
19
- "@glimstone/core": "5.0.3"
19
+ "@glimstone/core": "5.0.4"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "@internationalized/date": "^3.12.4",