当页面上有iframe时,输入自动对焦

时间:2017-03-01 10:59:26

标签: javascript reactjs iframe autofocus

我在项目中使用react和redux。我在页面上有输入和iframe。在组件函数“componentDidMount”中,我编写了这样的代码(这只是一个例子):

componentDidMount() {
    this.input.focus();
}

如果页面上有iframe,则自动对焦不起作用,但如果我删除iframe,则自动对焦将起作用。可能是什么问题?

P.S。抱歉我的英文。

0 个答案:

没有答案