搜尋

首頁  >  問答  >  主體

javascript - react componentDidMount中trigger('click')失效

componentDidMount能取得到真實Dom,但trigger('click')還是失效,有沒有大神能解決!

仅有的幸福仅有的幸福2833 天前624

全部回覆(1)我來回復

  • 滿天的星座

    滿天的星座2017-05-19 10:39:43

    我測試input text,$('').focus是有效的,input file無效,問題應該是瀏覽器做了安全限制。
    This is due to a security restriction.Most browsers prevent submitting files when the input field didn't receive a direct click or keyboard click event as a security precaution.

    回覆
    0
  • 取消回覆