Code Monkey home page Code Monkey logo

react-native-mentions's People

Contributors

harshq avatar martincamen avatar parrryy avatar pi-chan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-mentions's Issues

Hide scrollbar

Hi, is there anyway to hide the scrollbar, in my case the horizontal scroll bar?

RN ScrollView has the prop showsHorizontalScrollIndicator={false}, perhaps this could be passed into the MentionsTextInput component to handle this.

Multiple Trigger characters

Can we allow multiple triggers?

For our use case, we use @ to target users and # to target channels. Different autocomplete values... As trigger is a string, it cannot do this at the moment.

It looks like identifyKeyword would be compatible with that string being a regex pattern (eg [@#] or (@|#)) but onChangeText does a literal last character comparison...

What do you think?

[Android] Absolute position not working

Style: suggestionPanelContainer: {
    backgroundColor: 'rgba(100,100,100,0.1)',
    width: DeviceUiInfo.screenSize.width - pageMargin * 2,
    position: 'absolute',
    top: -150,
    zIndex: 1
  }

I've tried with all possible attempts I've failed to get desired output. @harshq please help to overcome this problem.

Suggestions for Colouring Tags

Hello, I love this MentionsTextInput component!

Now, I am facing the following challenge : I need to give a different font colour to the mention that the user has selected (like mentions on Facebook). For this I will have to split (or embed) the TextInput component. This seems quite difficult/complex.

Has anyone already given some thought on how to approach this?

Actually, what I need is Facebook's Draft.js capabilities on React Native. So far, this module is the thing that brought me the closest. Any suggestion on which direction to move forward, is highly appreciated!

Thank you.

Customize @mentions colors

Hi, is it possible to customize the background-color of the @mention, like Facebook for example ? And to delete the all @mention name in one click and not delete letter by letter like now ?

Highlight mentions?

Thank you for this awesome library!

Would you know how can we add the option to highlight the mentions after selection?

Please reduce package size its 33Mb?

The package size is extremely large and taking tons of time to download in my system.
Please remove the sample from the published package using npmignore.

check this out,
wget https://registry.yarnpkg.com/react-native-mentions/-/react-native-mentions-1.1.4.tgz

Something is causing the package size to bloat hugely

PaddingVertical does not work evenly

Thanks for this splendid library.

How do you get this library to respect the vertical padding set to the textinputstyle? And is there anyway to not have to set a min and max height to the textinput?

Normally, RN's textinput respects the padding set on a textinput so that as you fill in multiple lines of text the vertical padding is respected. With RNM the textinput's vertical padding disappears as soon as multiple lines of text are inputted. At times it looks like its trying to adjust and add the padding in toward the bottom fo the text but there's a delay to it.

screen shot 2018-08-10 at 5 41 17 pm

Also, unless you specify a minimum height the textinput collapses. Is it necessary to compensate for the positioning of the suggestions row?

Usernames cannot have dots in them

const pattern = new RegExp(`\\${boundary}${this.props.trigger}[a-z0-9_-]+|\\${boundary}${this.props.trigger}`, `gi`);

This assumes all usernames match that syntax.

We have a username with @first.lastname. The result of this code is that the keyword passed to our triggerCallback does not contain anything including and after the dot.

Suggest that the regex is exposed as a param and defaults to its current value?

Unable to use ref?

It is imposible to show the keyboard with this.inputRef.focus() because there seems to be no way to use ref?

Am I missing something here, it would be super nice to have this!

Displaying human names in place of @mention?

I'm hoping to duplicate the exact user experience with facebook's mobile app....

I was wondering if it's possible to display a human name "John Davis" rather than just "@JohnDavis3", based on the item selected? And then when pressing backspace, that it clear the full name (or last name) all at once, rather than one letter at a time?

I noticed there was info on how to add background coloring (#7), but that shows the formatted text absolutely positioning on top of the textinput, which has transparent text... This would work except the only issue is if we're using a human name instead of the encoded @name, it's likely not the same length so the cursor is going to be in the wrong place. The human name could be longer than the @name (which could be padded), but it could also be shorter (which can't really be padded).

Any suggestions?

React-Native 0.47 errors onChange

React-Native Errors on
onChange={(event) => { this.setState({ textInputHeight: this.props.textInputMinHeight >= event.nativeEvent.contentSize.height ? this.props.textInputMinHeight : event.nativeEvent.contentSize.height, }); } }
at event.nativeEvent.contentSize.height

Remove samples folder from published package

Hello,
samples folder (410MB) has been included in the published package which lead to a package size of 140MB.
Can you please bump a new version without this folder to reduce the package size?

problem when input trigger โ€˜@โ€™ at middle of text

Just run into this components, I was developing something quite alike components as your's, and there's tough issue that when input the trigger word at the middle of text, it should be show the suggestionView, I havent not run the demo, just viewed the code, i thought the component might be helpless at this case.
my solution is to diff the changed text every time to decide to show/off the suggestion view when onKeyPress listener receive the provided trigger value

no offense, just as a test case

Show suggestions even after selecting one and editing the @mention

This is what I mean.

  1. On Instagram comments, type:
    @john
  2. Tap on any user suggestion
  3. The result text comment will be:
    @john (notice the white space)
    The suggestions UI will disappear.
  4. Delete the whitespace and the suggestions appear again.

How would we add this feature?

'trigger' property as an array

I was looking for a component to manage mention suggestion in my app and I found yours. The only problem is that I also need in the same input a hashtag suggestion.

I can't do it with your component because the prop trigger only accepts a string.

Do you think we could change this to also accept an array of string (['@', '#'] for my case)?

If you think it could be added to your component but you don't have time to implement it just tell me and I will create a PR for that.

Good job for the component!

ListView Horizontal

Does it have to be horizontal by default?
I wish we could set it's orientation. Is this something you'd be willing to add/change?

Oh and thanks for the library.

Split out mentions box into separate render function / component

Is it possible to separate the suggestion panel flatlist into another component? It's more than a bit tricky right now to position the mentions box when it's inside the same view as the textinput. I'm attempting to have it sit flush on top of a textinput which has buttons on either end but that doesn't seem to be possible without some sort of position: 'absolute' gymnastics which won't work on android due to overflow issues.

Callback is not working; suggestions do not get updated when I type

Hello,

I am having an issue with the callback function. I have trigger={'#'} so when I type # then it does show me the suggestions. However, suggestions does not get updated with matching suggestions when I continue typing.

Below is the example of what I mean

image

Here is my code for MentionsTextInput:
image

Here is my callback function:
image

I am actually importing sample hashTag data from local json file through
import * as hashTagData from '../data/sampleHashTagData.json';

And in the componentDidMount(), I am setting that data to the state:
componentDidMount() { this.setState({ hashTags: hashTagData.results, }); }

Could you anyone please help me solve this issue?

Add prop listKey to Flatlist

Hello,

I have this error

A VirtualizedList contains a cell which itself contains more than one VirtualizedList of the same orientation as the parent list. You must pass a unique listKey prop to each sibling list.

please add prop listKey to Flatlist. Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.