niuware / mui-rte

Material-UI Rich Text Editor and Viewer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Autocomplete

Jyboer13 opened this issue · comments

Hello! Autocomplete only opens if I enter two characters after the trigger character. Is it possible to open the autocomplete by entering only the @ symbol or open it manually, by pressing a button for example?

<MUIRichTextEditor
defaultValue={content}
key="key"
label={"Label"}
id="comment"
controls={[
'bold',
'italic',
'strikethrough',
'numberList',
'bulletList',
'link',
'send',
]}
onChange={onChange}
onFocus={onFocus}
onBlur={onBlur}
ref={ref}
customControls={[
{
name: 'send',
icon: isEmpty ? : ,
type: 'callback',
onClick: onSubmit,
inlineStyle: {
backgroundColor: 'black',
color: 'white',
},
},
]}
autocomplete={{
strategies: [
{
items: ['item 1', 'item2'],
triggerChar: '@',
insertSpaceAfter: true,
},
],
}}
decorators={[
{
component: MentionDecorator,
regex: /\B@[/.\w]+/g,
},
]}
/>