`@effect/ui-native` (Effect-TS/ui): `kit/Pan` nested inside a pressable ancestor never activates on move
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- react-native, typescript
- 领域
- mobile
调研方向
从 packages/ui-native/src/kit/Pan.ts 第 296–300 行附近开始,追踪后续移动事件如何使用初始触摸目标。将其行为与链接的复现测试 08-pan-inside-pressable-never-activates-on-move/repro.test.ts 进行比较。当嵌套的 Pan 在移动超过阈值后激活、取消祖先的 press,并以预期的位移发出 pan 和 panEnd 时,即为完成。
由索引模型根据 Issue 内容生成。
描述
partially generated with help of my ai friend - neon 4.4
Hi effect team,
I was trying out this package and wanted to report some bugs encountered while porting a library to effect native
What version of Effect is running?
effect:4.1.7@effect/ui&@effect/ui-native:Effect-TS/uimainat77391ee50ae3d3175d670facbf675e9a819ba6a6react-native:0.88.1
What steps can reproduce the bug?
- Clone the minimal reproduction repository:
git clone https://github.com/cliffordfajardo/effectui-native-error-reproductions.git cd effectui-native-error-reproductions pnpm install pnpm vitest run 08-pan-inside-pressable-never-activates-on-move - Render a view with
Pan(axis: "x",threshold: 6) inside a parent view that has apressevent handler (for example, a draggable thumb inside a tap-to-seek track, or a swipe handle inside a pressable card). - Dispatch
topTouchStarton the childPannode, followed by a horizontaltopTouchMove(+24 px) andtopTouchEnd(see08-pan-inside-pressable-never-activates-on-move/repro.test.ts).
What is the expected behavior?
Dragging past threshold along the configured axis on the child Pan should activate Pan, cancel the ancestor press, and fire pan and panEnd (dx = 24), just as it does when the parent has no press handler.
What do you see instead?
Pan never activates and emits zero pan or panEnd events.
In packages/ui-native/src/kit/Pan.ts:296-300:
if (phase === 0) {
const press = pressed(n)
from = press ?? n
ask(n, press, payload)
} else if (owner === undefined) ask(from, undefined, payload)
On phase === 0 (topTouchStart), pressed(n) returns the ancestor pressable node press, so from is set to press rather than the actual touch target n. Because threshold > 0 (or axis is constrained), ready() is false at (dx = 0, dy = 0), so owner remains undefined. On subsequent phase === 1 (topTouchMove) events, ask(from, undefined, payload) walks upward starting from press (press -> press.parent -> ...) and never visits the descendant n again.
Additional information
Keeping from = n (the actual touch target) on phase === 0 so subsequent ask(from, ...) walks start from the child Pan node — while still passing press (or resolving pressed(n) when claiming) to cancel the ancestor pressable — allows nested Pan recognizers inside pressable ancestors to activate properly.
- 主要语言
- TypeScript
- 星标
- 16.7k
- 派生
- 808
- 平均合并
- 21 小时 22 分钟
- 30 天内合并 PR
- 486
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Effect-TS/effect 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
`@effect/ui-native` (Effect-TS/ui): `kit/VirtualList` `list` part widens `R` to `any`, poisoning enclosing components可能已有人在做 @effect-bot 今天认领。 未关闭
Effect-TS/effect#11097 · 已指派 1 人 ·
维护者通常 1 天内回复
-
`@effect/ui-native` (Effect-TS/ui): Controlled `input` rejected-edit restore never calls `host.commit()`可能已有人在做 @effect-bot 今天认领。 未关闭
Effect-TS/effect#11096 · 已指派 1 人 ·
维护者通常 1 天内回复
-
`@effect/ui-native` (Effect-TS/ui): `internal/focus.ts` `trackKeyboard` ignores `keyboardWillChangeFrame` / `keyboardDidChangeFrame` dismissal可能已有人在做 @effect-bot 今天认领。 未关闭
Effect-TS/effect#11095 · 已指派 1 人 ·
维护者通常 1 天内回复
相似的 Issue
-
check:failed streams:edit
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
[Bug]: Critical path skips a child span that ends exactly when the next one starts可能已有人在做 @Piyush4801 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
jaegertracing/jaeger-ui#4865 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 90/100
anthropics/claude-code#112972 ·
-
Type: Improvement
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复