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

picker组件在桌面浏览器上不能点击 #890

Open
tomnattle opened this issue Jul 7, 2021 · 5 comments
Open

picker组件在桌面浏览器上不能点击 #890

tomnattle opened this issue Jul 7, 2021 · 5 comments

Comments

@tomnattle
Copy link

我们使用的taro开发企业微信h5,taro中的组件使用的是weui组件,该组件在手机端工作,在桌面浏览器如:webkit中点击无效.
改组件地址:https://weui.io/work/#picker,
已查明原因:
`

{pickerItem}
` touch相关的事件部分浏览器不支持,但是现在企业微信开发的h5,用户群不止手机,也包括PC上使用,我添加了phantom-limb库零时解决了,期望weui的picker能支持桌面了浏览器
@tomnattle
Copy link
Author

<div className='weui-picker__group' onTouchStart={onTouchStart} onTouchMove={onTouchMove} onTouchEnd={onTouchEnd} > <div className='weui-picker__mask' /> <div className='weui-picker__indicator' /> <div className='weui-picker__content' style={this.getPosition()}> {pickerItem} </div> </div>

@tomnattle
Copy link
Author

我最后的解决方法是:复制改组件,名字改为PickerEx, 修改pick-group/index.js
isTouchDevice() ? <div className='weui-picker__group' onTouchStart={onTouchStart} onTouchMove={onTouchMove} onTouchEnd={onTouchEnd} > <div className='weui-picker__mask'/> <div className='weui-picker__indicator'/> <div className='weui-picker__content' style={this.getPosition()}> {pickerItem} </div> </div> : <div className='weui-picker__group' onMouseDown={(e)=>{ onTouchEnd({ ...e, changedTouches: [{ clientY: e.clientY }] }) }} onMouseUp={(e)=>{ onTouchStart({ ...e, changedTouches: [{ clientY: e.clientY }] }) }} > <div className='weui-picker__mask'/> <div className='weui-picker__indicator'/> <div className='weui-picker__content' style={this.getPosition()}> {pickerItem} </div> </div>

@milkyu
Copy link

milkyu commented Aug 31, 2021

这库还有人维护吗

@rikapo
Copy link

rikapo commented Aug 31, 2021

@milkyu 不知道 我加了交流群但还没审核 希望有人维护

@milkyu
Copy link

milkyu commented Aug 31, 2021

自己看源码 搞搞吧。。

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

3 participants