Giter Club home page Giter Club logo

Comments (21)

tommoor avatar tommoor commented on May 28, 2024 1

looks like this feature is now in the library and this should be closed?

from react-tags.

vkbansal avatar vkbansal commented on May 28, 2024

You can try passing null to removeComponent prop if you do not want to show deletex.

from react-tags.

aaronucsd avatar aaronucsd commented on May 28, 2024

I tried but didn't work. Maybe i did it wrong?

<ReactTags tags={tags} suggestions={suggestions} removeComponent={null} handleDelete={this.handleDelete} handleAddition={this.handleAddition} handleDrag={this.handleDrag} />

from react-tags.

vkbansal avatar vkbansal commented on May 28, 2024

try using empty <span/> tag like this

<ReactTags tags={tags} suggestions={suggestions} removeComponent={<span/>}
    handleDelete={this.handleDelete} handleAddition={this.handleAddition}
    handleDrag={this.handleDrag} />

from react-tags.

aaronucsd avatar aaronucsd commented on May 28, 2024

That gave me errors.

Warning: Failed propType: Invalid propremoveComponentof typeobjectsupplied toReactTags, expectedfunction. Check the render method ofDragDropContext(ReactTags).

from react-tags.

vkbansal avatar vkbansal commented on May 28, 2024

removeComponent must be a function, according to the src;

So use () => <span/> instead

from react-tags.

aaronucsd avatar aaronucsd commented on May 28, 2024

this works but i still need a view only mode, meaning the input field needs to go away (i prefer not have to add css to do this).

removeComponent = () => <span/>; <ReactTags tags={tags} suggestions={suggestions} removeComponent={this.removeComponent} handleDelete={this.handleDelete} handleAddition={this.handleAddition} handleDrag={this.handleDrag} />

from react-tags.

vkbansal avatar vkbansal commented on May 28, 2024

OK I'll try putting up a PR for it.

from react-tags.

aaronucsd avatar aaronucsd commented on May 28, 2024

Thanks! It be great just to have a easy flag to set to make it all read only (no delete x and input), as this is a real use case, where i show tags that does not allow for edit.

from react-tags.

vkbansal avatar vkbansal commented on May 28, 2024

Added in #49

from react-tags.

aaronucsd avatar aaronucsd commented on May 28, 2024

I did a npm update, and i think i got the latest, as i was able to add the new prop but did not see the readonly mode kick in.

from the call:
// INIT FAKE DATA
`const fakeData = {
tags: [{ id: 1, text: 'Apples' }],
suggestions: ['Banana', 'Mango', 'Pear', 'Apricot', 'Peach', 'Strawberry'],
};

const options = {
readOnly: true,
};
const elementTable = < TagList data={fakeData} options={options} />;

render(elementTable, compNode);`

inside of my component wrapper of ReactTags <ReactTags tags={tags} suggestions={suggestions} handleDelete={this.handleDelete} handleAddition={this.handleAddition} handleDrag={this.handleDrag} readOnly={this.props.options.readOnly}/>

from react-tags.

aaronucsd avatar aaronucsd commented on May 28, 2024

maybe bump the version and re-publish?

from react-tags.

vkbansal avatar vkbansal commented on May 28, 2024

If you require it urgently, you can change your package.json as follows

"react-tag-input": "prakhar1989/react-tags"

and run npm update

from react-tags.

aaronucsd avatar aaronucsd commented on May 28, 2024

Interesting. When can i get it through a regular update? I thought the PR
was approved and merged, no?

On Mon, Feb 29, 2016 at 4:57 PM, Vivek Kumar Bansal <
[email protected]> wrote:

If you require it urgently, you can change your package.json as follows

"react-tag-input": "prakhar1989/react-tags"

and run npm update

Regards,
-Long Huynh

from react-tags.

vkbansal avatar vkbansal commented on May 28, 2024

@prakhar1989 Just did it

from react-tags.

aaronucsd avatar aaronucsd commented on May 28, 2024

I see. :)
I thought it was approved, as you updated the readme.

Regards,
-Long Huynh

On Mon, Feb 29, 2016 at 5:13 PM, Vivek Kumar Bansal <
[email protected]> wrote:

depends on @prakhar1989 https://github.com/prakhar1989


Reply to this email directly or view it on GitHub
#46 (comment)
.

from react-tags.

vkbansal avatar vkbansal commented on May 28, 2024

@prakhar1989 Just did it

from react-tags.

aaronucsd avatar aaronucsd commented on May 28, 2024

Yeah I saw. Lol. Thanks man. This is great.
On Feb 29, 2016 5:18 PM, "Vivek Kumar Bansal" [email protected]
wrote:

@prakhar1989 https://github.com/prakhar1989 Just did it


Reply to this email directly or view it on GitHub
#46 (comment)
.

from react-tags.

aaronucsd avatar aaronucsd commented on May 28, 2024

Got it now! Works like a charm. Only thing i would comment on is when it's
readOnly mode, the drag-n-drop is disabled but i still get a cross mouse
icon on hovering. We might want to take that out too so it's not confusing.
Else perfect. Thanks!

Regards,
-Long Huynh

On Mon, Feb 29, 2016 at 5:21 PM, Long Huynh [email protected] wrote:

Yeah I saw. Lol. Thanks man. This is great.
On Feb 29, 2016 5:18 PM, "Vivek Kumar Bansal" [email protected]
wrote:

@prakhar1989 https://github.com/prakhar1989 Just did it


Reply to this email directly or view it on GitHub
#46 (comment)
.

from react-tags.

cklab avatar cklab commented on May 28, 2024

Running into an issue with the readOnly feature: page breaks unless we explicitly set autofocus to false.

edit: see PR #53

from react-tags.

prakhar1989 avatar prakhar1989 commented on May 28, 2024

Thanks for pointing this out @tommoor.

from react-tags.

Related Issues (20)

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.