云泥
云泥
> hey @liuyib , what do you think about the below method > > ### `event.composedPath().includes(clickawayInputRef.current)` > it will work even if the children which are clicked are removed from...
可以考虑支持 --- 相关:https://github.com/alibaba/hooks/issues/2300
第二个参数处理成 options 和我的想法完全一致,秀哦~,review 了一部分,剩下的回头有空再继续看
可以考虑。~~在原来的 useHistoryTravel 上加个参数,比如 manual: boolean, 实现手动就可以了,没必要新加 hook~~ (目前已经支持)。 类似的, VueUse 的 [useDebouncedRefHistory](https://vueuse.org/core/useDebouncedRefHistory/) [useThrottledRefHistory](https://vueuse.org/core/useThrottledRefHistory/) 都可以通过加参数在 ahooks 中实现
> 我既想用 setState 又想用 commit 现有的 useHistoryTravel 已经满足你的这个需求了,见 demo:https://codesandbox.io/s/ahooks-issue-2272-cpkh7s 另外,写这个 demo 时我发现,**目前的已经支持手动提交记录**了,就看你怎么用 setValue 了。直接 onChange 中调用 setValue 就是自动。onChange 里把值暂存到另一个 useState 中,然后再在其他地方手动 setValue,就是手动。
> 需要关心的数据用 value 来记录 这样吗?(既能自动保存,又能手动保存,数据是用 value 来记录)https://codesandbox.io/s/ahooks-issue-2272-demo2-h2l2t8?file=/App.tsx:119-127
@Debbl 我理解你的需求了,感谢提供的 [demo 项目](https://github.com/Debbl/svg-drawing),很 nice。确实有必要支持一下手动 commit,至于通过加参数支持,还是新 hook,我更倾向于通过加参数。 我后面处理下,有兴趣你也可以来个 PR 支持下,我来 review~
对应 PR: https://github.com/alibaba/hooks/pull/1972 相关问题:https://github.com/alibaba/hooks/pull/2327#issuecomment-1738347411 --- 应该还需要加个参数来控制“是否深拷贝值”然后用于对比: https://github.com/alibaba/hooks/pull/2327/files 
和这个问题差不多:https://github.com/alibaba/hooks/pull/2133 快速滑动时,类似于点击了,导致 moveThreshold 生效不了,目前来看是这样的原因,还在进一步确认中。
之前我好像确实理解错了,我再排查下这个问题