Spectrum: Fix nested mentions

Created on 27 Apr 2018  ·  5Comments  ·  Source: withspectrum/spectrum

@alejandronanez in #2945:

If you write this in Spectrum:

@scoped/package
@scoped/package
@scoped/package
@scoped/package

You'll end up with this:

screen shot 2018-04-26 at 4 36 00 pm

Bug good first issue (taken)

Most helpful comment

@alejandronanez that'd be great, thank you! :100:

All 5 comments

I'm pretty sure this has to do with how I set the key prop on the mention component, which is very hacky at the minute. We gotta find a better way to do that...

Since I just touched that piece of code, I’d like to give this a shot.

Can you please assign it to me?

@alejandronanez that'd be great, thank you! :100:

So, I'm pretty sure the issue is not related to the way you added key to mentions ✅

I'm pretty sure I have to make a change to createMentionsDecorator in shared/clients/draft-js/mentions-decorator/core.js. But, I'm having a hard time understanding what's the role of the callback function used in the forEach loop; it seems that it transforms plain text mentions into actual clickable links, but I still don't get it. I already checked in redraft's docs but couldn't find anything relevant.

Can you give me some context about what you wanted to achieve by using that callback?

Thanks! ✌️

FWIW I already have a PR open to fix this 😸 https://github.com/withspectrum/spectrum/pull/2976

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mxstbr picture mxstbr  ·  3Comments

brianlovin picture brianlovin  ·  5Comments

brianlovin picture brianlovin  ·  3Comments

mattgaunt picture mattgaunt  ·  4Comments

atlx picture atlx  ·  5Comments