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

[AutoCompelete] onClose calls twice and before onRequestNew #5819

Closed
avocadowastaken opened this issue Dec 24, 2016 · 1 comment
Closed

[AutoCompelete] onClose calls twice and before onRequestNew #5819

avocadowastaken opened this issue Dec 24, 2016 · 1 comment
Labels
component: autocomplete This is the name of the generic UI component, not the React module!

Comments

@avocadowastaken
Copy link
Contributor

  1. Click to input - onFocus
  2. Start typing - onUpdateInput
  3. Selected option -

PS. Here the workaround (Hail to the rxjs!)

import {mapPropsStream, createEventHandler} from 'recompose'
...
const {stream: onCloseStream, handler: onClose} = createEventHandler()
...
onCloseStream
  .delay(0) // so it would run after `onRequestNew`
  .debounceTime(10) // so it would run once in that period of time
  .withLatestFrom(propsStream.pluck('onBlur'))
  .map(fp.nth(1))
  .do((onBlur) => onBlur())
...
<AutoComplete
   {...props}
   menuCloseDelay={0} // should be zero (or you can change `debounceTime` to `menuCloseDelay + 10`)
/>
@oliviertassinari
Copy link
Member

Closed by #4783

@oliviertassinari oliviertassinari added the component: autocomplete This is the name of the generic UI component, not the React module! label Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: autocomplete This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

2 participants