@rc-component/trigger 3.6.12 → 3.6.14

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.
@@ -5,5 +5,5 @@ export interface UniqueProviderProps {
5
5
  /** Additional handle options data to do the customize info */
6
6
  postTriggerProps?: (options: UniqueShowOptions) => UniqueShowOptions;
7
7
  }
8
- declare const UniqueProvider: ({ children, postTriggerProps }: UniqueProviderProps) => React.JSX.Element;
8
+ declare const UniqueProvider: ({ children, postTriggerProps, }: UniqueProviderProps) => React.JSX.Element;
9
9
  export default UniqueProvider;
@@ -89,6 +89,11 @@ const UniqueProvider = ({
89
89
  hide
90
90
  }), []);
91
91
 
92
+ // =========================== Align ============================
93
+ React.useEffect(() => {
94
+ onAlign();
95
+ }, [mergedOptions?.target]);
96
+
92
97
  // =========================== Motion ===========================
93
98
  const onPrepare = useEvent(() => {
94
99
  onAlign();
package/es/index.js CHANGED
@@ -190,9 +190,9 @@ export function generateTrigger(PortalComponent = Portal) {
190
190
  useLayoutEffect(() => {
191
191
  if (uniqueContext && unique && targetEle && !openUncontrolled && !parentContext) {
192
192
  if (mergedOpen) {
193
- uniqueContext.show(getUniqueOptions(0), isOpen);
193
+ uniqueContext.show(getUniqueOptions(mouseEnterDelay), isOpen);
194
194
  } else {
195
- uniqueContext.hide(0);
195
+ uniqueContext.hide(mouseLeaveDelay);
196
196
  }
197
197
  }
198
198
  }, [mergedOpen, targetEle]);
@@ -5,5 +5,5 @@ export interface UniqueProviderProps {
5
5
  /** Additional handle options data to do the customize info */
6
6
  postTriggerProps?: (options: UniqueShowOptions) => UniqueShowOptions;
7
7
  }
8
- declare const UniqueProvider: ({ children, postTriggerProps }: UniqueProviderProps) => React.JSX.Element;
8
+ declare const UniqueProvider: ({ children, postTriggerProps, }: UniqueProviderProps) => React.JSX.Element;
9
9
  export default UniqueProvider;
@@ -98,6 +98,11 @@ const UniqueProvider = ({
98
98
  hide
99
99
  }), []);
100
100
 
101
+ // =========================== Align ============================
102
+ React.useEffect(() => {
103
+ onAlign();
104
+ }, [mergedOptions?.target]);
105
+
101
106
  // =========================== Motion ===========================
102
107
  const onPrepare = (0, _util.useEvent)(() => {
103
108
  onAlign();
package/lib/index.js CHANGED
@@ -204,9 +204,9 @@ function generateTrigger(PortalComponent = _portal.default) {
204
204
  (0, _useLayoutEffect.default)(() => {
205
205
  if (uniqueContext && unique && targetEle && !openUncontrolled && !parentContext) {
206
206
  if (mergedOpen) {
207
- uniqueContext.show(getUniqueOptions(0), isOpen);
207
+ uniqueContext.show(getUniqueOptions(mouseEnterDelay), isOpen);
208
208
  } else {
209
- uniqueContext.hide(0);
209
+ uniqueContext.hide(mouseLeaveDelay);
210
210
  }
211
211
  }
212
212
  }, [mergedOpen, targetEle]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rc-component/trigger",
3
- "version": "3.6.12",
3
+ "version": "3.6.14",
4
4
  "description": "base abstract trigger component for react",
5
5
  "engines": {
6
6
  "node": ">=8.x"