@box/blueprint-web 18.5.3 → 18.5.5
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.
|
@@ -93,7 +93,10 @@ const BaseGridListItem = /*#__PURE__*/forwardRef(function BaseGridListItem(props
|
|
|
93
93
|
* WHAT THIS DOES:
|
|
94
94
|
* - Checkbox clicks: propagate → toggle selection
|
|
95
95
|
* - Action buttons: propagate → button handlers fire
|
|
96
|
-
* - Content/empty space: stop propagation, trigger onAction
|
|
96
|
+
* - Content/empty space: stop pointerdown propagation, trigger onAction on click
|
|
97
|
+
*
|
|
98
|
+
* onAction waits for click rather than pointerdown so that starting a drag, or a touch scroll,
|
|
99
|
+
* does not also activate the item. Browsers do not fire click after a native drag.
|
|
97
100
|
*
|
|
98
101
|
* Grid-v2 single-select is the exception: content clicks propagate so React Aria selects the
|
|
99
102
|
* item, and onAction fires afterwards from handleContentClick.
|
|
@@ -102,9 +105,7 @@ const BaseGridListItem = /*#__PURE__*/forwardRef(function BaseGridListItem(props
|
|
|
102
105
|
if (!isGridListContentTarget(e.target) || ownsAction) {
|
|
103
106
|
return;
|
|
104
107
|
}
|
|
105
|
-
// Stop propagation for content clicks, then trigger onAction
|
|
106
108
|
e.stopPropagation();
|
|
107
|
-
fireAction(rest.id ?? textValue);
|
|
108
109
|
};
|
|
109
110
|
// Only single-select resolves keys through the DOM, so the marker is scoped to that path.
|
|
110
111
|
const numericKeyProps = ownsAction && typeof rest.id === 'number' ? {
|
|
@@ -114,10 +115,17 @@ const BaseGridListItem = /*#__PURE__*/forwardRef(function BaseGridListItem(props
|
|
|
114
115
|
// The key comes from the DOM so that onAction and onSelectionChange always report the same
|
|
115
116
|
// React Aria collection key, including when the consumer relies on an auto-generated one.
|
|
116
117
|
const handleContentClick = e => {
|
|
117
|
-
if (!
|
|
118
|
+
if (!isGridListContentTarget(e.target)) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (ownsAction) {
|
|
122
|
+
fireAction(getGridListItemKeyFromTarget(e.target) ?? rest.id ?? textValue);
|
|
118
123
|
return;
|
|
119
124
|
}
|
|
120
|
-
|
|
125
|
+
// React Aria handles clicks without a preceding pointerdown (screen readers, element.click())
|
|
126
|
+
// as presses, which would fire onAction a second time.
|
|
127
|
+
e.stopPropagation();
|
|
128
|
+
fireAction(rest.id ?? textValue);
|
|
121
129
|
};
|
|
122
130
|
// Only apply pointer handler for V2 layouts in interactive mode
|
|
123
131
|
const pointerDownHandler = isV2Layout && isInteractive ? handleContentPointerDown : undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/blueprint-web",
|
|
3
|
-
"version": "18.5.
|
|
3
|
+
"version": "18.5.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"publishConfig": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@ariakit/react": "0.4.21",
|
|
57
57
|
"@ariakit/react-core": "0.4.21",
|
|
58
|
-
"@box/blueprint-web-assets": "^5.13.
|
|
58
|
+
"@box/blueprint-web-assets": "^5.13.2",
|
|
59
59
|
"@internationalized/date": "^3.12.0",
|
|
60
60
|
"@radix-ui/react-accordion": "1.1.2",
|
|
61
61
|
"@radix-ui/react-checkbox": "1.0.4",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"devDependencies": {
|
|
86
86
|
"@box/box-test-client": "^3.2.7",
|
|
87
87
|
"@box/playwright-utils": "^2.8.5",
|
|
88
|
-
"@box/storybook-utils": "^1.4.
|
|
88
|
+
"@box/storybook-utils": "^1.4.21",
|
|
89
89
|
"@figma/code-connect": "1.4.4",
|
|
90
90
|
"@playwright/test": "1.46.1",
|
|
91
91
|
"@types/js-yaml": "^4.0.9",
|