ant-design The step element does not highlight on scrollIntoViewOptions: { behavior: 'smooth'}

vkc1a9a2  于 3个月前  发布在  其他
关注(0)|答案(8)|浏览(35)

Steps to reproduce

The tour component does not highlight the step that is using { behavior: 'smooth'} in scrollIntoViewOptions. It is scrolling to the element but not highlighting the step area.

What is expected?

The step area should not have the mask over.

What is actually happening?

The step area is having a mask over.
| Environment | Info |
| ------------ | ------------ |
| antd | 5.20.2 |
| React | react |
| System | ubantu 22 |
| Browser | Chrome |

1l5u6lss

1l5u6lss2#

The highlight box cannot move when screen is scrolled or resized

n6lpvg4x

n6lpvg4x3#

@MadCcc has someone picked this issue? I can pick it up if no one is working on it. Please assign it to me

rvpgvaaj

rvpgvaaj4#

@MadCcc I submitted a solution, please review.

kx5bkwkv

kx5bkwkv5#

Is'nt using setTimeout a counter intuitive approach? Wouldn't it cause unexpected behavours? I had also just implemented a solution using IntersectionObserver API and was just about to test it to see if it worked

zzlelutf

zzlelutf6#

@Neumann615 Please, check your solution again as it is not working as expected. I tested the changed files in local.
@MadCcc I have submitted a working solution for this bug on react-component/tour repo. Please, check and review.

mzmfm0qo

mzmfm0qo7#

I think the reason for this bug is just that our positioning function conflicts with the browser scrolling animation event, so it's better to find a way to avoid it, and not introduce something extra to calculate or check

kadbb459

kadbb4598#

@MadCcc@abhishekdeepmindz
😑Sorry, I seem to have misconcepted it, but it's been fixed and it should work now.
preview: https://rc-tour.xiaonuo.love/demo/scroll-into-viewhttps://rc-tour.vercel.app/demo/scroll-into-view

相关问题