question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not Inserting text

See original GitHub issue

I’m having a problem with quill-mention and react-quill.

The lists of options populate fine, and I’m able to search and select options, but when I select an option the tag is not inserted into quill. Quill will only show that a new paragraph has been added, but no other content is added.

`mention: { allowedChars: /^[A-Za-z0-9_\sÅÄÖåäö]*$/, mentionDenotationChars: [“@”, “#”], isolateCharacter: true, source: function (searchTerm, renderList, mentionChar) { let values;

			if (mentionChar === "@") {
				values = mentionList;
			} else {
				values = tagList;
			}

			if (searchTerm.length === 0) {
				renderList(values, searchTerm);
			} else {
				const matches = [];
				for (var i = 0; i < values.length; i++)
					if (~values[i].value.toLowerCase().indexOf(searchTerm.toLowerCase())) matches.push(values[i]);
				renderList(matches, searchTerm);
			}
		},
	},`

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
crazypenguinguycommented, May 24, 2019

It looks like my problem was due to using the Formats Whitelist with react-quill, I added mention to this list. The solution was given in issue #78

Editor.formats = [
  'header', 'font', 'size',
  'bold', 'italic', 'underline', 'strike', 'blockquote',
  'list', 'bullet', 'indent',
  'link', 'image', 'video', 'mention'
]
1reaction
just-Bricommented, Jul 31, 2021

I’m now having this issue, nad have added mention to the formats list:

<ReactQuill
  theme="snow"
  value={quillValue.text}
  onChange={(e) => setQuillValue({ text: e })}
  modules={{ mention: mentionModule }}
  formats={[
    'header',
    'font',
    'size',
    'bold',
    'italic',
    'underline',
    'strike',
    'blockquote',
    'list',
    'bullet',
    'indent',
    'link',
    'image',
    'video',
    'mention',
  ]}
/>

And here is my current mentionModule:

  const mentionModule = {
    allowedChars: /^[A-Za-z\s]*$/,
    mentionDenotationChars: ['@'],
    source: (searchTerm: string, renderList: (data: any, searchText: string) => void) => {
      const mentionsToList = atValues.filter(
        (av) => av.value.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1
      );
      if (mentionsToList.length > 0) {
        renderList(mentionsToList, searchTerm);
      }
    },
  };

Was kind of a pain getting it to work typescript but I got there. Anyone have any suggestions?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Get Microsoft Word to Stop Deleting as You Type
1. Press the "Ins" key to toggle overtype mode off. Depending on your keyboard model, this key may also be labeled "Insert." If...
Read more >
Text disappears as I type - Microsoft Support
Troubleshoot why text disappears when you type, and how to fix it. ... Overtype mode is turned on and the Insert key was...
Read more >
TKinter not inserting a string to Text widget - Stack Overflow
You're trying to concatenate "Notes: " and notes , but sometimes notes is None, and you can't add None to a string.
Read more >
Word 2000: Insert and Overtype Mode - GCFGlobal
This means text to the right of the insertion point moves to the right as you type new text. Insert mode adds text,...
Read more >
How to TURN OFF & ON Text Overwrite on Windows 10 ...
Do you want to know how to turn off or on text overwrite on windows 10 ... Sometimes when I'm writing an email,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found