Skip to content
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

Bug: Mentions triggered somehow for list types #4976

Closed
safa-kajabi opened this issue Sep 7, 2023 · 7 comments
Closed

Bug: Mentions triggered somehow for list types #4976

safa-kajabi opened this issue Sep 7, 2023 · 7 comments

Comments

@safa-kajabi
Copy link

Lexical version: "@lexical/react": "^0.12.0",

Steps To Reproduce

-- Make sure that you are using the mentions plugin --

  1. Create a list
  2. Click the first word beside the dot or number type in the list and you will see the mentions
Screen.Recording.2023-09-07.at.13.36.08.mov

Link to code example:

https://playground.lexical.dev/

The current behavior

It shows the mentions when we click the word in the list

The expected behavior

It should not trigger the mentions if it is not a mention.

@acywatson
Copy link
Contributor

I think we should just disable the capital-word trigger for the playground mentions plugin. It's annoying and trivial to implement if someone wants to do it in their own editor.

@safa-kajabi
Copy link
Author

I think we should just disable the capital-word trigger for the playground mentions plugin. It's annoying and trivial to implement if someone wants to do it in their own editor.

Yeah this is the problem. What should ı do to disable it in my own editor ? @acywatson

@safa-kajabi
Copy link
Author

I think we can disable it with returning the "match" instead of using the checkForCapitalizedNameMentions function. Right?

export const getPossibleQueryMatch = (text: string): MenuTextMatch | null => {
  const match = checkForAtSignMentions(text, 1);
   return match;
  return match === null ? checkForCapitalizedNameMentions(text, 3) : match;
};

@acywatson
Copy link
Contributor

I think we can disable it with returning the "match" instead of using the checkForCapitalizedNameMentions function. Right?

export const getPossibleQueryMatch = (text: string): MenuTextMatch | null => {
  const match = checkForAtSignMentions(text, 1);
   return match;
  return match === null ? checkForCapitalizedNameMentions(text, 3) : match;
};

yep, that works!

return match === null ? checkForCapitalizedNameMentions(text, 3) : match;

@safa-kajabi
Copy link
Author

Nice! Thanks!

@acywatson
Copy link
Contributor

#4991

@safa-kajabi
Copy link
Author

#4991

Thanks a lot!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants