react-vant icon indicating copy to clipboard operation
react-vant copied to clipboard

🐛 [Bug]: Picker 组件在通过 form.setFieldValue 设置 value 的问题

Open tianxing0923 opened this issue 1 year ago • 0 comments

Which React Vant packages are impacted?

  • [X] react-vant (React Vant core)
  • [ ] react-vant-icons(React Vant Icon)

What version of React Vant are you using?

3.3.3

Reproduce live demo(codesandebox or stackblitz)?

https://codesandbox.io/p/sandbox/biao-dan-xiang-lei-xing-forked-d83gzc?file=%2FApp.tsx%3A9%2C12

Descripition

Picker 组件在表单中通过 form.setFieldValue 设置 value 后,在 chrome 下正常,但在 ios safari、微信webview 和 mac safari 内第一次弹出的时候没有选中,关闭后第二次弹出才选中,经过调试发现是 PickerInner 内的 useDebounceEffect 导致,把 wait 设置大一点时没有问题,怀疑是 debounce 内的 setTimeout 浏览器差异所致

测试版本: mac: macOS Monterey (12.1) M1 ios: 17.3.1 safari: 15.2 (17612.3.6.1.6) chrome: 121.0.6167.184 (arm64)

tianxing0923 avatar Feb 26 '24 11:02 tianxing0923