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

Fixing some issues with AutoComplete #231

Closed
wants to merge 1 commit into from

Conversation

alan-cruz2
Copy link

@alan-cruz2 alan-cruz2 commented Aug 11, 2017

Background issues:

  1. If using FormsyAutoComplete a user begins to type and uses the keyboard to select the first option in the AutoComplete menus (Keyboard, not mouse click) handleBlur will set _value before the selected autocomplete item text is set in the input.

  2. If, for some reason, blur is not triggered on the AutoComplete element, an incorrect value can be set for the formsy element/model.

  3. Could not reset MUI AutoComplete component using [AutoCompleteComponent].setState({ searchText: '' }) because FormsyAutoComplete did not provide access to component.

This PR:

  • Gives access to muiComponent
  • Uses setValue instead of setState

Copy link
Collaborator

@ryanblakeley ryanblakeley left a comment

Choose a reason for hiding this comment

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

Thanks for jumping in with a fix. It looks like with this component we still use this.state.value for passing the value to Formsy here. So we might need to add this.setValue, but I don't think we want to drop this.setState({ value }).

Tag v0.6.2

Update acknowledgements

setMuiComponent_autoComplete
setting value of auto complete

Addresses two problems:
- If using FormsyAutoComplete a user begins to type and uses the keyboard to select the first option in the AutoComplete menus (Keyboard, not mouse click) `handleBlur` will set `_value` before the selected autocomplete item text is set in the input.
- If, for some reason, `blur` is not triggered on the AutoComplete element, an incorrect value can be set for the formsy element/model.

Since there is little value of having a state attribute of `value` lets use the helper function (through the mixin) to guarantee that formsy has the most "up-to-date" value.
Merge pull request #2 from alan-cruz2/patch-1

setMuiComponent_autoComplete
Merge pull request #1 from alan-cruz2/using_setValue_autocomplete

setting value of auto complete
Update FormsyAutoComplete.jsx
Update FormsyAutoComplete.jsx
Merge pull request #3 from alan-cruz2/adding-back-setState

Update FormsyAutoComplete.jsx
@alan-cruz2
Copy link
Author

@rojobuffalo sorry it took so long. I squashed the commits into one, but it looks like I squashed one too many together. Sorry. let me know if this is a problem and I can fix it.

@rkuykendall
Copy link
Member

rkuykendall commented Dec 8, 2020

Hi @alan-cruz2! I know it's been a few years, but this project is coming back to life! The first step is getting all the old PRs either closed or merged.

  • If you have any interest in getting this PR merged let me know ASAP and I'd be happy to help!
  • If you'd like to join the project, I'd be happy to partner with you
  • If you have moved on (after only 3 years?!?) that's fine too! But I'd appreciate a response anyways!

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

Successfully merging this pull request may close these issues.

3 participants