Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

range: 百度小程序下获取不到对应的dom #1021

Closed
jsonz1993 opened this issue Apr 20, 2020 · 6 comments
Closed

range: 百度小程序下获取不到对应的dom #1021

jsonz1993 opened this issue Apr 20, 2020 · 6 comments
Assignees
Milestone

Comments

@jsonz1993
Copy link
Contributor

jsonz1993 commented Apr 20, 2020

taro-ui: 2.3.0

range组件在百度小程序下,delayQuerySelector(..., 0)获取不到对应的dom,微信小程序下不会,除了把延迟时间0改为300之外还有没有什么比较好的处理方式?

@taro-ui-bot
Copy link

taro-ui-bot bot commented Apr 20, 2020

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@Garfield550
Copy link
Collaborator

delayQuerySelector 本身就是一个 hack

@jsonz1993
Copy link
Contributor Author

是啊....但是我总觉得这种碰运气形的加延迟时间,心里没啥谱,虽然本地测试微信和百度端300都没问题

@Garfield550
Copy link
Collaborator

小程序端各种行为表现都不一致,Taro UI 组件里有很多代码根据 Taro env 去做判断然后各种 hack。

如果各端表现一致一点就没有 delayQuerySelector 这种情况出现了,然后 Taro 的一个特殊点也是各端直接调用各端的 API,没有强制把各端 API 重新封装然后保持行为一致(这么做工作量太大),所以得框架自行按照各端处理。

@Garfield550 Garfield550 self-assigned this Apr 20, 2020
@Garfield550 Garfield550 added this to the Taro UI 2.3.4 milestone Apr 20, 2020
@Garfield550
Copy link
Collaborator

开发工具 3.5.1 和基础库 3.170.10,Taro 2.1.5 可以在 0ms 延迟下获取到 DOM,不知道是不是你当时的 Taro 版本或者开发工具问题。

@Garfield550
Copy link
Collaborator

为了以防万一我改成 30ms 延迟,你下个版本再试一下吧。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants