Skip to content

Commit

Permalink
Merge pull request #4295 from nextcloud/backport/3875/stable7
Browse files Browse the repository at this point in the history
  • Loading branch information
Pytal committed Jun 30, 2023
2 parents c03ec94 + 84a0883 commit 75dd35e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/components/NcRichContenteditable/NcRichContenteditable.vue
Expand Up @@ -160,8 +160,8 @@ export default {
aria-multiline="true"
class="rich-contenteditable__input"
role="textbox"
v-on="listeners"
@input="onInput"
v-on="$listeners"
@keydown.delete="onDelete"
@keydown.enter.exact="onEnter"
@keydown.ctrl.enter.exact.stop.prevent="onCtrlEnter"
Expand Down Expand Up @@ -423,6 +423,23 @@ export default {
canEdit() {
return this.contenteditable && !this.disabled
},
/**
* Proxied native event handlers without custom event handlers
*
* @return {Record<string, Function>}
*/
listeners() {
/**
* All component's event handlers are set as native event handlers with by v-on directive.
* The component also raised custom events manually by $emit for corresponding events.
* As a result, it triggers handlers twice.
* The v-on="listeners" directive should only set proxied native events handler without custom events
*/
const listeners = { ...this.$listeners }
delete listeners.paste
return listeners
},
},
watch: {
Expand Down

0 comments on commit 75dd35e

Please sign in to comment.