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

Dropdown events triggering twice #504

Closed
mclarentgp opened this issue Sep 16, 2016 · 4 comments
Closed

Dropdown events triggering twice #504

mclarentgp opened this issue Sep 16, 2016 · 4 comments
Labels

Comments

@mclarentgp
Copy link
Contributor

mclarentgp commented Sep 16, 2016

I'm having an issue where I have a dropdown with an OnChange event that calls a function updateFilter that is being triggered twice. My function updateFilter gets called once when i click the dropdown and select an item in the list and another after clicking elsewhere on the browser that is not the dropdown.

I have the following set up.

const options = [ { text: 'item1', value: '1' }, { text: 'item2', value: '2' }, ]

updateFilter = (e, value) => console.log(e)

<Dropdown selection options={options} onChange={this.updateFilter} />

after clicking the dropdown and selecting a value i see the following in the console
"Proxy {dispatchConfig: Object, _targetInst: ReactDOMComponent, _dispatchListeners: Array[2], _dispatchInstances: Array[2], nativeEvent: MouseEvent"

after performing the above actions i click anywhere else on the browser that is not the dropdown and see the following in the console
"Proxy {dispatchConfig: Object, _targetInst: ReactDOMComponent, _dispatchInstances: ReactDOMComponent, nativeEvent: FocusEvent, type: "blur"...}"

Is this a bug or am i doing something wrong?

@levithomason
Copy link
Member

I am unable to reproduce this. Can you report your OS, browser, and stardust versions?

Mac OSX Yosemite 10.10.5 (14F1912)
Google Chrome Version 53.0.2785.116 (64-bit)
stardust@0.44.3

@mclarentgp
Copy link
Contributor Author

mclarentgp commented Sep 18, 2016

Windows 8.1
Googe Chrome Version 52.0.2743.116 m
Firefox Version 48.0.2
stardust@0.44.3

Im using react@15.3.1 if that matters.

@levithomason
Copy link
Member

Thanks, I was able to reproduce this after creating a simplified example. See #508 for the fix. I'll release it as soon as tests pass.

@levithomason
Copy link
Member

levithomason commented Sep 18, 2016

Fixed in stardust@0.44.4, thanks again.

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

No branches or pull requests

2 participants