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

始终都会阻止冒泡 #913

Closed
mushan0x0 opened this issue Oct 23, 2018 · 8 comments
Closed

始终都会阻止冒泡 #913

mushan0x0 opened this issue Oct 23, 2018 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@mushan0x0
Copy link
Contributor

mushan0x0 commented Oct 23, 2018


问题描述
始终都会阻止冒泡

复现步骤

const a = false
if (a) {
   e.stopPropagation() // 始终会阻止冒泡
}

期望行为
支持判断再阻止冒泡

报错信息

[这里请贴上你的完整报错截图或文字]

系统信息

  • 操作系统: [e.g. Windows 10]
  • Taro 版本 [v.1.1.0-beta.8]
  • Node.js 版本 [e.g. v9.0.0]
  • 报错平台 [weapp]
@AwesomeDevin
Copy link

AwesomeDevin commented Apr 8, 2019

问题描述

e.stopPropagation() 写在条件语句中,未执行, 仍然会阻止事件冒泡 ,导致页面无法滚动

复现步骤
[复现问题的步骤]

  1. 监听容器的ontouchmove事件
  2. 添加条件语句并e.stopPropagation()
  3. 条件语句未执行,仍然会阻止事件冒泡,导致页面无法滚动
  move(e){
    let val = (e.changedTouches[0].clientY-100) 
    if(val>1){
      console.log('stop')
      e.stopPropagation()
    }
    else{
      console.log(123)
    }
  }

期望行为
支持判断再阻止冒泡

报错信息
控制台仅仅输出了"123",并没有"stop",仍然阻止ontouchmove事件冒泡,页面无法滚动

系统信息

  • 操作系统:windows7
  • Taro 版本 1.2.4
  • Node.js 版本 8.9.3
  • 报错平台 weapp

@asbstty
Copy link

asbstty commented May 11, 2019

发现了同样的问题,求解

@zzz1220
Copy link

zzz1220 commented Aug 5, 2019

遇到同样的问题,这个问题解决了吗?

@yuche
Copy link
Contributor

yuche commented Aug 5, 2019

动态组织冒泡在 Taro 中是不可行的,解决方案请看:

#761 (comment)

@yuche yuche closed this as completed Aug 5, 2019
@icewind7030
Copy link

@yuche 这个解决方案并不是动态阻止冒泡啊?这个需求没办法实现吗?

@alesjia
Copy link

alesjia commented Jan 10, 2020

这个问题感觉没有解决,只要代码中有stopPropagation,那么事件就都被阻止了

@Zephyrrro
Copy link

遇到了同样的问题,目前还是没有解决方案么。。。

@alesjia
Copy link

alesjia commented May 4, 2020 via email

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

No branches or pull requests

9 participants