监控当前点击事件 滚动条对于层的影响

 useEffect(() => {
    //更新滚动条的位置
    if (flightAreaSafetyState == 'in progress') {
      inputRef.scrollTop = inputRef.scrollHeight;
    }
  }, [flightAreaSafetyState]);
 
 
  useEffect(() => {
    if (currentindex > 0) {
      document.getElementById(`step${currentindex}`)?.scrollIntoView({
        behavior: 'smooth',
        block: 'center',
        inline: 'center',
      });
    }
  }, [currentindex, flightAreaSafetyState]);

posted on 2024-05-16 10:34  漫思  阅读(5)  评论(0编辑  收藏  举报

导航