Comments (21)
looks like this feature is now in the library and this should be closed?
from react-tags.
You can try passing null
to removeComponent
prop if you do not want to show deletex
.
from react-tags.
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.
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.
That gave me errors.
Warning: Failed propType: Invalid prop
removeComponentof type
objectsupplied to
ReactTags, expected
function. Check the render method of
DragDropContext(ReactTags).
from react-tags.
removeComponent
must be a function, according to the src
;
So use () => <span/>
instead
from react-tags.
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.
OK I'll try putting up a PR for it.
from react-tags.
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.
Added in #49
from react-tags.
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.
maybe bump the version and re-publish?
from react-tags.
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.
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.
@prakhar1989 Just did it
from react-tags.
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.
@prakhar1989 Just did it
from react-tags.
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.
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.
Running into an issue with the readOnly feature: page breaks unless we explicitly set autofocus to false.
edit: see PR #53
from react-tags.
Thanks for pointing this out @tommoor.
from react-tags.
Related Issues (20)
- Dead link in readme HOT 1
- Add semi-random colors to tags
- Padding css property not impacting layout of Tags Input
- handleInputChange should probably(?) fire when the user adds a tag HOT 1
- j th
- j thh t
- j thh tht
- Check the render method of `WithContext`.
- Where is the style.css file in the demo gif?
- Add support for max number of tags allowed HOT 2
- Allow parent component to pass in a React node as the input box
- Migrate the docs to Docusaurus HOT 7
- Dev Build is broken
- Add Semantic pull request GitHub Action HOT 4
- allowUnique prop allows to add non-unique values
- Warning: Tag: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead. HOT 1
- Issue: a form field element should have an id or name attribute HOT 1
- Edit tag in the input box.
- Using a custom icon instead of the x character for the remove button HOT 1
- Move to Typescript
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-tags.