Skip to content
This repository has been archived by the owner on Dec 23, 2022. It is now read-only.

Make autocomplete MenuItems customizable #173

Merged
merged 6 commits into from
Dec 28, 2017
Merged

Make autocomplete MenuItems customizable #173

merged 6 commits into from
Dec 28, 2017

Conversation

abduvaliiev
Copy link
Contributor

Fixes #172

  • Added ability to process object chips

Rustam Abduvaliiev added 2 commits December 27, 2017 18:56
* Added ability to process object chips
* Fixed creating empty chips when there is no text in input
@leMaik leMaik changed the title Fixes https://github.com/TeamWertarbyte/material-ui-chip-input/issues… Make autocomplete MenuItems customizable Dec 28, 2017
@leMaik
Copy link
Member

leMaik commented Dec 28, 2017

I don't see how the changes in this PR is related to the issue.

Edit: Now I get it. 👍

src/ChipInput.js Outdated
@@ -343,6 +343,16 @@ class ChipInput extends React.Component {
}
}

if (typeof chip === 'object') {
if (chip[this.props.dataSourceConfig.text].length === 0 || chip[this.props.dataSourceConfig.value].length === 0) {
Copy link
Member

Choose a reason for hiding this comment

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

This can be removed, it's already handled below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean line 347? Or both?

Copy link
Member

Choose a reason for hiding this comment

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

Removing everything would revert your PR. 😄 I mean lines 347–349

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not handled, because if we will not add such checking - we will get an empty chip by pressing "enter"
dec-28-2017 17-39-53

Copy link
Member

Choose a reason for hiding this comment

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

Oh, you're right. It's fine then.

src/ChipInput.js Outdated
@@ -343,6 +343,16 @@ class ChipInput extends React.Component {
}
}

if (typeof chip === 'object') {
Copy link
Member

Choose a reason for hiding this comment

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

Would you mind changing this to else if (typeof chip === 'object')?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

Choose a reason for hiding this comment

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

Did you push your changes? I don't see it yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wanted to push everything together

Rustam Abduvaliiev added 2 commits December 28, 2017 17:46
* Fixed code style
* Removed obsolete code
@abduvaliiev
Copy link
Contributor Author

Anything else to fix?

@leMaik
Copy link
Member

leMaik commented Dec 28, 2017

Maybe you could add a story to the storybook that shows how to use this to customize the menu items and ensure that no other stories break?

@abduvaliiev
Copy link
Contributor Author

Sure, also I've found one more bug, need to investigate

* Added storybook example
@abduvaliiev
Copy link
Contributor Author

abduvaliiev commented Dec 28, 2017

I was mistaken, there were no bug, story added, stories did not break

@leMaik leMaik merged commit ac1d255 into TeamWertarbyte:master Dec 28, 2017
@leMaik
Copy link
Member

leMaik commented Dec 28, 2017

@darkchaplain Thank you very much! 👍 I'll publish a new release very soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants