code: function(ev) {
            if (sourceElem === target[0] && ev.target === target[0]) {
              ev.stopPropagation();
              ev.preventDefault();
  
              smartClose();
            }
          }
docs: We check if our original element and the target is the backdrop because if the original was the backdrop and the target was inside the dialog we don't want to dialog to close.