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

Commit

Permalink
Removed change and keydown events
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasHirt committed May 25, 2020
1 parent 95f738a commit 4c698dd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
7 changes: 7 additions & 0 deletions changelog/unreleased/remove-input-custom-events
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Change: Removed change and keydown events from text input

We've removed change and keydown custom events from text input component.
All listeners are passed to the input element so all events are still accessible.
Focus and input events are still implemented as custom events.

https://github.com/owncloud/owncloud-design-system/pull/768
2 changes: 1 addition & 1 deletion src/elements/OcModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
:disabled="inputDisabled"
:fix-message-line="true"
@input="$_ocModal_input_onInput"
@change="$_ocModal_confirm"
@keydown.enter="$_ocModal_confirm"
/>
<p
v-else
Expand Down
20 changes: 3 additions & 17 deletions src/elements/OcTextInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
v-on="$_ocTextInput_listeners"
@input="$_ocTextInput_onInput($event.target.value)"
@focus="$_ocTextInput_onFocus($event.target)"
@keydown="$_ocTextInput_onKeyDown($event)"
ref="input"
/>
<div class="oc-text-input-message" v-if="$_ocTextInput_showMessageLine">
Expand Down Expand Up @@ -108,9 +107,11 @@ export default {
},
$_ocTextInput_listeners() {
const listeners = this.$listeners
// Delete listeners for events which are emitted via methods
delete(listeners["input"])
delete(listeners["focus"])
delete(listeners["keydown"])
return listeners
}
},
Expand All @@ -137,21 +138,6 @@ export default {
**/
this.$emit("focus", target.value)
},
$_ocTextInput_onKeyDown(e) {
if (e.keyCode === 13) {
/**
* Change event - emitted as soon as the user hits enter
* @type {string}
*/
this.$emit("change", e.target.value)
}
/**
* KeyDown event - emitted as soon as the user hits a key
* @type {event}
*/
this.$emit("keydown", e)
},
},
}
</script>
Expand Down

0 comments on commit 4c698dd

Please sign in to comment.