nextcloud-libraries/nextcloud-vue

[NcRichContenteditable] Pressing ESC not only closes the link picker but also unfocuses the input

Closed this issue · 4 comments

A part of #5351

Not reproducible in @nextcloud/vue, only in Talk.

Happens after #4907

Talk handled tribute active status via its tribute-active-true/tribute-active-false events. But these events don't bubble and don't work when tribute target is not the root element of the component.

https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html#migration-strategy

.native should be removed anyway (which we using for Talk), so I'd say, easiest way would be to emit event from the component

.native should be removed anyway (which we using for Talk), so I'd say, easiest way would be to emit event from the component

It is not actually breaking, it will just work the same in Vue 3 after removing .native. This is a problem for migration only when there is a component event with exactly the same name as a native event.

Talk needed tribute-active-* events to handle @keydown.esc only for input itself, not when Escape closes Tribute autocomplite. A better solution from the NcRichContenteditable side would be to not bubble keydown for escape that closes autocomplete.

Emitting tribute-active-* events as it is also means that Tribute is now a part of the component interface and cannot be replaced with an alternative solution.