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

Backtop target is invalid #6366

Closed
cnchore opened this issue Jun 5, 2017 · 3 comments
Closed

Backtop target is invalid #6366

cnchore opened this issue Jun 5, 2017 · 3 comments

Comments

@cnchore
Copy link

cnchore commented Jun 5, 2017

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不可见

@afc163
Copy link
Member

afc163 commented Jun 6, 2017

The div in your codepen is not even scrollable!

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

@afc163 afc163 closed this as completed Jun 6, 2017
@dujun-bot
Copy link

dujun-bot commented Nov 13, 2017

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?

@bchenSyd
Copy link
Contributor

bchenSyd commented Mar 8, 2018

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

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

4 participants