You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem I am facing
The Mention extension seems to only use the items array that the plugin was initialized with. I need the items to be reactive because my use case is a list of online users, which is constantly changing. My list of online users is passed as a prop to the component, and the items function is not reacting to changes to that prop.
The solution I would like
The Mention extension's items should be reactive
Alternatives I have considered
Currently the only solution to this I am aware of is remounting the editor every time the list of online users changes, which is obviously not ideal.
I also tried using a function that returns the online users array, but that did not change anything.
The text was updated successfully, but these errors were encountered:
Hey, the usage of the mention extension is a bit abstract to provide the same API for plainJS/Vue/React. But there are 3 ways to pass your items:
// 1. get items synchronouslyMention.configure({suggestion: {items: query=>{return[// ...]},// ...},})// 2. get items asynchronouslyMention.configure({suggestion: {items: asyncquery=>{awaitnewPromise(()=>{// API request or something})},// ...},})// 3. handle items within your Vue/React component and don't use `suggestion.items` at allMention.configure({suggestion: {render: ()=>{letcomponentreturn{onStart: props=>{component=newVueRenderer(MentionList,{parent: this,// `props` contains `query` which you can use to filter your items within your component// you can use provide/inject/Vuex/Redux/whatever to get yor reactive items within this componentpropsData: props,})}}},},})
The problem I am facing
The
Mention
extension seems to only use theitems
array that the plugin was initialized with. I need theitems
to be reactive because my use case is a list of online users, which is constantly changing. My list of online users is passed as a prop to the component, and theitems
function is not reacting to changes to that prop.The solution I would like
The
Mention
extension'sitems
should be reactiveAlternatives I have considered
Currently the only solution to this I am aware of is remounting the editor every time the list of online users changes, which is obviously not ideal.
I also tried using a function that returns the online users array, but that did not change anything.
The text was updated successfully, but these errors were encountered: