-
Notifications
You must be signed in to change notification settings - Fork 84
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
web #32
base: master
Are you sure you want to change the base?
web #32
Conversation
maxhudson
commented
Feb 23, 2021
- web working
- space added after @name
- restructured component hierarchy some
onChangeText={onChangeInput} | ||
onSelectionChange={handleSelectionChange} | ||
/> | ||
{/** @ts-expect-error */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with ts, so I'm not sure how to address the fact that it doesn't like these spreads properly
src/utils/utils.ts
Outdated
@@ -271,7 +271,7 @@ const generateValueWithAddedSuggestion = ( | |||
generatePlainTextPart(`${isInsertSpaceToNextPart ? ' ' : ''}${currentPart.text.substring(newMentionPartPosition.end)}`), | |||
|
|||
...parts.slice(currentPartIndex + 1), | |||
]); | |||
]) + ' '; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove this if you want, but seems like standard mention behavior so user doesn't have to type the space themself
Thanks for your ideas and PR! I'll check it later. |
src/components/mention-input.tsx
Outdated
* - Keyword text (i.e. "mi" for @Mike) | ||
* + Length of space after mention (1) | ||
*/ | ||
const newCursorPosition = selection.start + suggestion.name.length - mentionType.trigger.length - keyword.length + 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to respect isInsertSpaceAfterMention
Hi @maxhudson! Tried to implement your changes locally. It works incorrectly on multiline typing for me. |
Hi @dabakovich ! Warning: Use the `defaultValue` or `value` props instead of setting children on <textarea>. The displayed text in the input is not updated either after pressing the Suggestion, but the input value is. Thank you for your work creating this lib, saves us a lot of time :) |