Ant-design: Backtop target is invalid

Created on 5 Jun 2017  ·  3Comments  ·  Source: ant-design/ant-design

Version

2.10.4

Environment

mac ox 10.11.6、chrome 58.0.3029.110、antd 2.10.4

Reproduction link

https://codepen.io/cnchore/pen/KqwNjr

Steps to reproduce

  1. backtop target 绑定div ;
  2. 滚动 div,backtop可见,点击可返回顶部;

What is expected?

滚动 div,backtop可见,点击可返回顶部;

What is actually happening?

滚动 div,backtop不可见

All 3 comments

The div in your codepen is not even scrollable!

https://codepen.io/anon/pen/yXyZqq?editors=0010

react 15 update 16.1.0

<BackToptarget={() => document.getElementById('backTop')}> <div> <Icon type="arrow-up" className='backTop' /> </div> </BackTop>
Warning: Invalid value for prop target on

tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://fb.me/react-attribute-behavior
in div (created by BackTop)
in AnimateChild (created by Animate)
in Animate (created by BackTop)
in BackTop (created by Product)
in div (created by BasicLayout)
in BasicLayout (created by Adapter)
in Adapter (created by Product)
in Product
in Unknown (created by Form(WrappedComponent))
in Form(WrappedComponent) (created by RouterContext)
in div (created by BasicLayout)
in BasicLayout (created by Adapter)
in Adapter (created by FirstPage)
in div (created by BasicLayout)
in BasicLayout (created by Adapter)
in Adapter (created by FirstPage)
in div (created by FirstPage)
in FirstPage (created by Connect(FirstPage))
in Connect(FirstPage) (created by RouterContext)
in RouterContext (created by Router)
in Router
in Provider

what's happend?

got the same warning
image

seems to me that target should be renamed to data-target to better fit customer attribute naming convention.
the component works as expected though

Was this page helpful?
0 / 5 - 0 ratings