react-component / scroll-anim

Animate Scroll React Component
http://react-component.github.io/scroll-anim/
MIT License
305 stars 43 forks source link

页面已经有Link, 再打开有Link的Modal, modal里的Link标签就失效 #33

Closed boxcc closed 6 years ago

boxcc commented 6 years ago

页面已经有Link标签, 并且有Modal页面, Modal里也有Link标签,

当打开modal后, modal里的所有Link都失效了

jljsj33 commented 6 years ago

请提供下 demo 。。。https://codesandbox.io/s/42vvz4j4yx

jljsj33 commented 6 years ago

锚点冲突可自行解决一下。。。

boxcc commented 6 years ago

我debug了一下 似乎 https://github.com/react-component/scroll-anim/blob/master/src/EventDispatcher.js#L32 这里没有重新addEventListener

demo 我试试能否重现 稍等

boxcc commented 6 years ago

不是锚点冲突, demo已经重现了, 异常问题是: 把注释的代码恢复后, 在modal里滚动, Link不会切换active的classname了

boxcc commented 6 years ago

我尝试了把所有

this._listFun[_type]

改为

this._listFun[`${_type}${target ? target.getAttribute('id') : ''}`]

可以解决问题

boxcc commented 6 years ago

不能解决问题...重新打开modal 还是有问题

boxcc commented 6 years ago

我提了个PR #34

jljsj33 commented 6 years ago

重现 demo 地址发个。。。

boxcc commented 6 years ago

@jljsj33 https://codesandbox.io/s/oj61k66816

异常问题是: 把注释的代码恢复后, 在modal里滚动, Link不会切换active

jljsj33 commented 6 years ago

modal 里控制页面里的滚动???

jljsj33 commented 6 years ago

打开 modal 页面是禁滚动了, 不建议在 modal 里使用。。。

boxcc commented 6 years ago

不是用了windows的滚动 另外modal里的div#qForm进行滚动, 如果一定要在modal里使用是否有解决办法吗?

jljsj33 commented 6 years ago

2.5.4