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

InfoWindow 设置offset时,第一次点击出现后,,再次点击多次,位置与第一次不一致

Open babycannotsay opened this issue 6 years ago • 3 comments

react-amap version

1.2.2

OS/Browers version

Reproduction Link

https://codepen.io/giggle/pen/jzOpRB

Steps to reproduce

What is Expected?

What is actually happening?

第一次点击时, amap-info对应的子div的bottom0, 后续都是offset数组中的的第二个值。 我在高德地图示例中心 用setOffset()测试过,不是原生的问题。自己也封装过信息窗体,也不会出现类似的情况。问题感觉是在源码上,找了好久没找到。

babycannotsay avatar Mar 09 '18 06:03 babycannotsay

Duplicate of #62 , 跟这个问题差不多是一个问题

babycannotsay avatar Mar 09 '18 07:03 babycannotsay

确认了这个问题,还在找原因。

临时可以这样解决:把 offset 属性设成引用而不是数组字面量。https://codepen.io/anon/pen/QmWJbW

ioslh avatar Mar 09 '18 08:03 ioslh

好的

babycannotsay avatar Mar 09 '18 08:03 babycannotsay