ScrollIntoView在Reactjs中不适用于I.E?

问题描述 投票:-1回答:1

基本上我有一个时间下拉列表,但是在I.E上所选时间没有滚动

scrollIntoView

if (open) {
  setTimeout(() => {
    this.props.value &&
      this[this.props.value] &&
      this[this.props.value].scrollIntoView({
        behavior: 'smooth',
        block: 'nearest',
        inline: 'nearest'
      });
  }, 300);
}
javascript reactjs internet-explorer-11 js-scrollintoview
1个回答
0
投票

我尝试检查您的示例代码,发现您正在尝试使用IE浏览器不支持的behavior:'smooth'

© www.soinside.com 2019 - 2024. All rights reserved.