-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When hitting "enter" to complete, enter is added to the document #8
Comments
Sorry for my late post, I was on vacation last week.
|
I did this super hacky thing: // When '}' is pressed while autocomplete is suggesting,
// accept the current suggestion.
quill.keyboard.addBinding({
key: 221,
format: [ 'suggest' ],
shiftKey: true
}, this._quillCompleteSuggestion.bind(this));
...
/**
* Complete the currently displayed autocomplete suggestion.
*
* @returns {boolean} - false. This prevents other keyboard bindings from
* running.
*/
_quillCompleteSuggestion() {
const autocomplete = this.quill.getModule('autocomplete');
autocomplete.close(autocomplete.matchedPlaceholders[0]);
return false;
} Which lets |
I guess you are not using the last version of this module: it should be 1.0.7. |
Yeah, I am using 1.0.7. |
When completing a placeholder, if you type "enter", then a carriage return is added to the document being edited:
I'm trying to modify this module so I can use "{" as my trigger key, but then also use "}" as the end-key in addition to enter, that way you can just type
{name}
to insert the name placeholder. Only, as things stand, I end up inserting{name}}
into the document.The text was updated successfully, but these errors were encountered: