     @get('previousFocus')?.focus()
 
     # Remove class set on body to disable page scrolling
-    $('body').removeClass('eui-modal-open')
+    $('body').toggleClass('eui-modal-open')
 
     if @get 'programmatic'
       @destroy()

      @.$().focus()

      # Add a class to the body element of the page so we can disable page scrolling
      $('body').addClass('eui-modal-open')


  # Initial setup when modal is used as a block component


  willDestroy: ->
    # Remove class set on body to disable page scrolling
    $('body').toggleClass('eui-modal-open')


  # Makes sure the tab focus cannot leave the modal since all user action is scoped to
