@rc-component/dialog 1.8.3 → 1.8.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.
@@ -40,7 +40,7 @@ const Panel = /*#__PURE__*/React.forwardRef((props, ref) => {
40
40
  } = React.useContext(RefContext);
41
41
  const internalRef = useRef(null);
42
42
  const mergedRef = useComposeRef(holderRef, panelRef, internalRef);
43
- useLockFocus(visible && isFixedPos && focusTrap !== false, () => internalRef.current);
43
+ const [ignoreElement] = useLockFocus(visible && isFixedPos && focusTrap !== false, () => internalRef.current);
44
44
  React.useImperativeHandle(ref, () => ({
45
45
  focus: () => {
46
46
  internalRef.current?.focus({
@@ -122,7 +122,10 @@ const Panel = /*#__PURE__*/React.forwardRef((props, ref) => {
122
122
  className: clsx(prefixCls, className),
123
123
  onMouseDown: onMouseDown,
124
124
  onMouseUp: onMouseUp,
125
- tabIndex: -1
125
+ tabIndex: -1,
126
+ onFocus: e => {
127
+ ignoreElement(e.target);
128
+ }
126
129
  }, /*#__PURE__*/React.createElement(MemoChildren, {
127
130
  shouldUpdate: visible || forceRender
128
131
  }, modalRender ? modalRender(content) : content));
@@ -49,7 +49,7 @@ const Panel = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
49
49
  } = _react.default.useContext(_context.RefContext);
50
50
  const internalRef = (0, _react.useRef)(null);
51
51
  const mergedRef = (0, _ref.useComposeRef)(holderRef, panelRef, internalRef);
52
- (0, _focus.useLockFocus)(visible && isFixedPos && focusTrap !== false, () => internalRef.current);
52
+ const [ignoreElement] = (0, _focus.useLockFocus)(visible && isFixedPos && focusTrap !== false, () => internalRef.current);
53
53
  _react.default.useImperativeHandle(ref, () => ({
54
54
  focus: () => {
55
55
  internalRef.current?.focus({
@@ -131,7 +131,10 @@ const Panel = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
131
131
  className: (0, _clsx.clsx)(prefixCls, className),
132
132
  onMouseDown: onMouseDown,
133
133
  onMouseUp: onMouseUp,
134
- tabIndex: -1
134
+ tabIndex: -1,
135
+ onFocus: e => {
136
+ ignoreElement(e.target);
137
+ }
135
138
  }, /*#__PURE__*/_react.default.createElement(_MemoChildren.default, {
136
139
  shouldUpdate: visible || forceRender
137
140
  }, modalRender ? modalRender(content) : content));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rc-component/dialog",
3
- "version": "1.8.3",
3
+ "version": "1.8.4",
4
4
  "description": "dialog ui component for react",
5
5
  "keywords": [
6
6
  "react",
@@ -51,7 +51,7 @@
51
51
  "dependencies": {
52
52
  "@rc-component/motion": "^1.1.3",
53
53
  "@rc-component/portal": "^2.1.0",
54
- "@rc-component/util": "^1.7.0",
54
+ "@rc-component/util": "^1.9.0",
55
55
  "clsx": "^2.1.1"
56
56
  },
57
57
  "devDependencies": {
@@ -87,4 +87,4 @@
87
87
  "react": ">=18.0.0",
88
88
  "react-dom": ">=18.0.0"
89
89
  }
90
- }
90
+ }