Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
Do not emit value if input is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasHirt committed May 11, 2020
1 parent f125e4d commit e073282
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions changelog/unreleased/modal-confirm-without-input-ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Do not try to emit value after confirming modal if input is missing

Confirming modal resulted in an error if the modal haven't got an input.
We've fixed this by not attempting to emit the value if the prop `hasInput` is set to false.

https://github.com/owncloud/owncloud-design-system/pull/749
4 changes: 3 additions & 1 deletion src/elements/OcModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,14 @@ export default {
},
$_ocModal_confirm() {
const value = this.hasInput ? this.$refs.ocModalInput.value : null
/**
* The user clicked on the confirm button. If input exists, emits it's value
*
* @property {String} inputValue Value of the input
*/
this.$emit("confirm", this.$refs.ocModalInput.value)
this.$emit("confirm", value)
},
$_ocModal_input_type() {
Expand Down

0 comments on commit e073282

Please sign in to comment.