diff --git a/docs/content/2.components/3.layout-group.md b/docs/content/2.components/3.layout-group.md
index 6a9e2b0..77d328f 100644
--- a/docs/content/2.components/3.layout-group.md
+++ b/docs/content/2.components/3.layout-group.md
@@ -23,10 +23,14 @@ Controls how the layout group inherits properties from its parent group. It can
## `Slots`
-### `default`: The default slot receives forceRender function:
+`default`: The default slot receives forceRender function:
- forceRender: A function that, when called, forces the slot Motion component to calculate its layout.
+::alert{type="warning" icon="lucide:triangle-alert"}
+ When a `Motion` component is wrapped by `LayoutGroup`, its update will trigger layout updates for all `Motion` components under the `LayoutGroup`, so it's better to trigger the `Motion` update instead of calling forceRender
+::
+
```vue
@@ -38,7 +42,7 @@ Controls how the layout group inherits properties from its parent group. It can
```
-## useLayoutGroup Hook
+## useLayoutGroup
The `useLayoutGroup` hook provides access to the layout group context, allowing components to participate in the layoutGroup and respond to forced layout.
diff --git a/packages/motion/src/components/__tests__/gesture.test.tsx b/packages/motion/src/components/__tests__/gesture.test.tsx
new file mode 100644
index 0000000..4a4e139
--- /dev/null
+++ b/packages/motion/src/components/__tests__/gesture.test.tsx
@@ -0,0 +1,28 @@
+/** @jsxRuntime classic */
+/** @jsxImportSource vue */
+import { mount } from '@vue/test-utils'
+import Motion from '../Motion.vue'
+import { describe, expect, it } from 'vitest'
+import { delay } from '@/shared/test'
+
+describe('gesture', () => {
+ it('hover effect triggered by parent', async () => {
+ const wrapper = mount({
+ setup() {
+ return () => (
+ // @ts-ignore
+
+ {/* @ts-ignore */}
+
+
+ )
+ },
+ })
+ wrapper.find('[data-testid="motion"]').trigger('pointerenter')
+ await delay(300)
+ expect(wrapper.find('[data-testid="motion-child"]').element.getAttribute('style')).toBe('transform: scale(1.2);')
+ wrapper.find('[data-testid="motion"]').trigger('pointerleave')
+ await delay(300)
+ expect(wrapper.find('[data-testid="motion-child"]').element.getAttribute('style')).toBe('transform: none;')
+ })
+})
diff --git a/packages/motion/src/components/animate-presence/AnimatePresence.vue b/packages/motion/src/components/animate-presence/AnimatePresence.vue
index 4c52ad7..ad5707b 100644
--- a/packages/motion/src/components/animate-presence/AnimatePresence.vue
+++ b/packages/motion/src/components/animate-presence/AnimatePresence.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/packages/motion/src/shared/test.ts b/packages/motion/src/shared/test.ts
new file mode 100644
index 0000000..dcc31de
--- /dev/null
+++ b/packages/motion/src/shared/test.ts
@@ -0,0 +1 @@
+export const delay = (ms: number) => new Promise(r => setTimeout(r, ms))
diff --git a/packages/motion/src/state/motion-state.ts b/packages/motion/src/state/motion-state.ts
index e6bccd2..3fb0d73 100644
--- a/packages/motion/src/state/motion-state.ts
+++ b/packages/motion/src/state/motion-state.ts
@@ -201,7 +201,7 @@ export class MotionState {
return
this.activeStates[name] = isActive
this.visualElement.variantChildren?.forEach((child) => {
- ((child as any).state as MotionState).setActive(name, isActive, false)
+ ((child as any).state as MotionState).setActive(name, isActive, !isActive)
})
if (isAnimate) {
this.animateUpdates()
@@ -288,7 +288,6 @@ export class MotionState {
getChildAnimations = getAnimations
childAnimations = animations
}
-
// Wait for all animation states to read from the DOM
// yield
diff --git a/packages/motion/tsconfig.json b/packages/motion/tsconfig.json
index 7c606a1..d6809a0 100644
--- a/packages/motion/tsconfig.json
+++ b/packages/motion/tsconfig.json
@@ -20,6 +20,6 @@
// Set to empty to avoid accidental inclusion of unwanted types
"types": []
},
- "include": ["./src/**/*.vue", "./src/**/*.ts"],
- "exclude": ["node_modules", "**/__tests__/*"]
+ "include": ["./src/**/*.vue", "./src/**/*.ts", "./src/**/*.tsx"],
+ "exclude": ["node_modules"]
}
diff --git a/packages/motion/vite.config.ts b/packages/motion/vite.config.ts
index 10e7a60..b906154 100644
--- a/packages/motion/vite.config.ts
+++ b/packages/motion/vite.config.ts
@@ -12,7 +12,7 @@ export default defineConfig({
dts({
cleanVueFileName: true,
outDir: 'dist',
- exclude: ['src/test/**', 'src/**/story/**', 'src/**/*.story.vue'],
+ exclude: ['src/**/__tests__/**', 'src/**/story/**', 'src/**/*.story.vue'],
afterBuild: async () => {
// pnpm build:plugins
execSync('pnpm build:plugins', { stdio: 'inherit', cwd: path.resolve(__dirname, '../plugins') })
diff --git a/tsconfig.json b/tsconfig.json
index 92ea6c2..2f10797 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -5,5 +5,5 @@
"baseUrl": "."
},
"include": ["./packages/**/*"],
- "exclude": ["node_modules", "**/__tests__/*"]
+ "exclude": ["node_modules"]
}