Skip to content

Commit

Permalink
Implement a new attribute to validate close clicks
Browse files Browse the repository at this point in the history
  • Loading branch information
erkie committed Aug 30, 2021
1 parent 464b891 commit 46d80fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions addon/components/basic-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ export default class BasicDialog extends Component {
if (modalEl && modalEl.contains(target)) {
return;
}
if (this.shouldIgnoreCloseClick && this.shouldIgnoreCloseClick(modalEl, target)) {
return;
}
if (this.onClose) {
this.onClose();
}
Expand Down
1 change: 1 addition & 0 deletions addon/templates/components/modal-dialog.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
value=this.value
onClickOverlay=this.onClickOverlayAction
onClose=this.onCloseAction
shouldIgnoreCloseClick=shouldIgnoreCloseClick
}}
{{yield}}
{{/component}}

0 comments on commit 46d80fc

Please sign in to comment.