Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

302
Views
Show popup in markdown after '@' sign to search for users

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');
 }
});
  1. After writing anything after '@' popup disappears.
  2. When I write something like '@an' and delete 'an' it's not showing popup again.
  3. When I lose focus from markdown and then focus it again and the caret is right after @ sign it isn't showing popup.

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.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

so the logic should be the following:

  1. user types input, and we use v-model to attach it to a data object. and we want to initiate a data variable isTag to false
  2. we want to listen to every word until we hear '@', so basically, we want to listen to the first click when input data is empty
  3. if we hear '@', we set isTag to true
  4. now, using v-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)

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!