microsoft / fluentui

Fluent UI web represents a collection of utilities, React components, and web components for building web applications.
https://react.fluentui.dev
Other
18.34k stars 2.72k forks source link

Dropdown - first option automatically selected on click of the control #12304

Closed Sendil85 closed 4 years ago

Sendil85 commented 4 years ago

When clicking on the control, first option automatically selected and onchange even got fired, its forcibly setting first option, if we intend to select other option, onchange event is getting fired twice.

Environment Information

Please provide a reproduction of the bug in a codepen:

Actual behavior:

Expected behavior:

Priorities and help requested:

Are you willing to submit a PR to fix? (Yes, No)

Requested priority: (Blocking, High, Normal, Low)

Products/sites affected: (if applicable)

aneeshack4 commented 4 years ago

@Sendil85 Thanks for reaching out to us. This doesn't repro - right now on the latest master https://developer.microsoft.com/en-us/fabric#/controls/web/dropdown, on click, there is not automatic selection. You can use defaultSelectedKeys to set dropdown items that you want to be default selected (for example in the multiselect example, this prop is set if you look in the show code button) but other than that, there's no automatic selection. In the future, to help us be actionable further, make sure to provide a codepen with repro steps on an isolated Fabric/Fluent component - fill out the template.

msft-github-bot commented 4 years ago

Thanks for taking the time to enter an issue. However, it seems that there aren't enough details here for this issue to be actionable.

When issues are created, we need details such as:

  1. Which Fabric component and which version of the Fabric component is causing the issue
  2. What behaviors and attributes are missing or incorrect
  3. What you expected and what is actually happening
  4. Confirmation that the problem reproduces in isolation

Without a clear understanding of these details, it's not possible to take clear action on issues. We are unable to meet your expectations, properly address the root cause, and make changes without affecting the expectations of other consumers.

Please provide these additional details as you are able. The default issue template provides an outline of these details and is viewable when creating a new issue. Additionally, if this is an accessibility issue, please see Accessibility Troubleshooting in our wiki for more guidance. If these details cannot be provided, please kindly close the bug.

Thank you for your patience.

silviuaavram commented 4 years ago

Provide clear repro steps, expected result, actual result, codesandbox with an example that reproduces the bug. Thanks!

silviuaavram commented 4 years ago

While working on Dropdown issues I found one that is probably related to this ticket. No idea exactly, based on the fact that I don't have repro steps for this issue, but it's just a hunch.

I will create a PR for this and 2 other issues and we will see if it solves your bug.

msft-github-bot commented 4 years ago

This issue has been automatically marked as stale because it has marked as requiring actionable feedback but has not had any activity for 2 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your contributions to Fabric React!