   componentDidMount: =>
     @setTop()
     $(window).on 'resize', @setTop
-    @inputBox.current?.focus() if @props.autoFocus
+
+    if @props.autoFocus
+      @disposers.add(core.reactTurbolinks.runAfterPageLoad => @inputBox.current?.focus())
 
 
   componentDidUpdate: (prevProps) =>

  constructor: (props) ->
    super props

    @inputBox = React.createRef()
    @throttledPost = _.throttle @post, 1000
    @handleKeyDown = InputHandler.textarea @handleKeyDownCallback

    $(window).off 'resize', @setTop
    @postXhr?.abort()
    @throttledPost.cancel()
    @disposers.forEach (disposer) => disposer?()


  render: =>
