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

TagPicker support for adding new tags #1001

Closed
panigrah opened this issue Feb 14, 2017 · 2 comments
Closed

TagPicker support for adding new tags #1001

panigrah opened this issue Feb 14, 2017 · 2 comments

Comments

@panigrah
Copy link

Does TagPicker have support for adding new tags? I was expecting to see a event handlers such as "onNewTag()" and "onRemoveTag()" in the api.

@panigrah
Copy link
Author

panigrah commented Mar 7, 2017

I worked it out so that the onResolveSuggestions handler adds and returns the filter text in the array. e.g.

    <TagPicker onResolveSuggestions={this._onResolveSuggestions} />

    _onResolveSuggestions(filterText, currentSelected, limitResults?) {
        let tags = ... //get list of tags from server or redux store or state
        tags.splice(0, 0, {key: filterText, name: filterText, state: 'new'})
        return  tags
    }

the onChange handler can then add or remove tags from the store by looking at the tags with a state of new

@panigrah panigrah closed this as completed Mar 7, 2017
@leoseccia
Copy link

I want to do the same thing but not quite sure how to go about it... I added a bounty on this StackOverflow question in the hope that someone will help...

@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants