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

web #32

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

web #32

wants to merge 4 commits into from

Conversation

maxhudson
Copy link

  • web working
  • space added after @name
  • restructured component hierarchy some

@maxhudson maxhudson mentioned this pull request Feb 23, 2021
onChangeText={onChangeInput}
onSelectionChange={handleSelectionChange}
/>
{/** @ts-expect-error */}
Copy link
Author

@maxhudson maxhudson Feb 23, 2021

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

@@ -271,7 +271,7 @@ const generateValueWithAddedSuggestion = (
generatePlainTextPart(`${isInsertSpaceToNextPart ? ' ' : ''}${currentPart.text.substring(newMentionPartPosition.end)}`),

...parts.slice(currentPartIndex + 1),
]);
]) + ' ';
Copy link
Author

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

@dabakovich
Copy link
Owner

Thanks for your ideas and PR! I'll check it later.

* - 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;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to respect isInsertSpaceAfterMention

@maxhudson maxhudson changed the title web + space after @name web Mar 2, 2021
@dabakovich
Copy link
Owner

Hi @maxhudson! Tried to implement your changes locally. It works incorrectly on multiline typing for me.

@HugDoggyDogg
Copy link

Hi @dabakovich !
I'd like to know if you have any plans to merge these changes at some point ?
I use the library in a company project and we could really use the web compatibility, which I believe can be provided by the latest commit here.
In our case it mostly works on web apart from rendering mentions inside the text input, which causes this issue in the console:

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 :)

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

Successfully merging this pull request may close these issues.

None yet

3 participants