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

Do not emit value if input is disabled in modal #749

Merged
merged 1 commit into from
May 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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