I'm trying to recreate functionality from Gitlab to show users list after writing '@' sign.
Currently I'm trying to add it to Tui Editor (using Vue).
I know how to listen for key up and add it as Widget, but it has a few drawbacks.
editor.on('keyup', (editorType, ev) => {
if (ev.key === '@') {
const userMenu = this.$refs.userMenu;
refEditor.addWidget(userMenu.$el, 'top');
}
});
At this point I'm not sure where I should start.
So it should work this way: writing '@' should show me popup and when I write letters it should filter users according to those letters. It should make popup window visible whenever @ is at the start of a word, so '@@' or 'f@' shouldn't work.
Using: ES6+, Vue 2, Tui Editor, Vuetify.
so the logic should be the following:
v-model to attach it to a data object. and we want to initiate a data variable isTag to falseisTag to truev-if, we can open our modal conditionally and listen using the v-model to the typing data as it changes.I don't know tui-editor, so I can only help you with vue code; it would be something like that (jsfiddle)