   componentWillUnmount: ->
     document.body.classList.remove(@documentBodyClass)
 
-  shouldPinHeader: (scrollTop) ->
-    scrollTop > @props.buffer
+  isScrollingSlowed: (prevScrollTop, currentScrollTop) ->
+    Math.abs(prevScrollTop - currentScrollTop) <= @props.scrollSpeedBuffer
+
+  isScrollingUp: (prevScrollTop, currentScrollTop) ->
+    (prevScrollTop - currentScrollTop) > @props.scrollSpeedBuffer
+
+  shouldPinHeader: (prevScrollTop, currentScrollTop) ->
+    if @isScrollingSlowed(prevScrollTop, currentScrollTop)
+      # keep as previous pinned state
+      shouldPinHeader = @state.pinned
+    else if @isScrollingUp(prevScrollTop, currentScrollTop)
+      # unpinned on upscroll
+      shouldPinHeader = false
+    else
+      # otherwise, on down scroll, check if the scroll position is past buffer
+      shouldPinHeader = (currentScrollTop > @props.buffer)
+
+    shouldPinHeader
 
   shouldComponentUpdate: (nextProps, nextState) ->
     # ignore scrolling state changes when checking should component update


  getDefaultProps: ->
    buffer: 60

  mixins: [ScrollListenerMixin]


    nextStateNoScroll = _.omit(nextState, 'isScrolling', 'scrollTop')

    # manually check if should pin has changed
    didShouldPinChange = not @state.pinned is @shouldPinHeader(@state.scrollTop, nextState.scrollTop)
    # check props and non-scroll states
    didPropsUpdate = not _.isEqual(@props, nextProps)
    didStateUpdate = not _.isEqual(stateNoScroll, nextStateNoScroll)
