-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 width to fit its longest option width #2228
Comments
Would love to see this fixed. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions to Fabric React! |
Any update on this bug? We are using the dropdown component in many UI pages. Fixing this issue would improve the readability for the user. Package version(s): (5.64) |
@artxach @manasark We investigated this bug and need more information to repro. Is it the width of the dropdown input field or the dropdown callout that you want to snap to the longest option? We are not seeing either width change based on which option is selected. The callout always snaps to the width of the input unless the 'dropdownWidth' prop is set. For really long options, the value can be read on hover. I created this codepen for testing: |
@lynamemi We want the dropdown width to fit the longest option in the dropdown input filed. |
@lynamemi Any update on the above request? |
@manasark Still not completely clear on the expected behavior here. Is it:
that you want to snap to the longest option's width? |
@lynamemi option 2 |
Ok sounds good. That one will probably take a little more time than the other. I can try to get to it in the next couple of weeks. |
For what it's worth, don't we want both 1 and 2? If I have a dropdown with "foo", "bar", and "baseball" in it, and I select "foo" and then show the dropdown, the dropdown will only truncate that last entry to "bas...". I suppose if we fix #2, that will also implicitly fix #1, right? Assuming that's the case, that would be ideal. Truncating strings looks terrible in a dropdown, and seeing the dropdown constantly change width depending on what is selected is also a bad experience. |
This issue has been automatically marked as stale because it has not activity for 60 days. It will be closed if no further activity occurs within 14 days of this comment. Thank you for your contributions to Fabric React! |
This issue has been automatically closed because it has not had recent activity after being marked as stale. If you belive this issue is still a problem or should be reopened, please reopen it! Thank you for your contributions to Fabric React! |
Bug Report
Describe the issue:
When a dropdown has many options with different lengths its width is being changed when selecting some option. Also when the options' list is opened it has a current option's width, so if the shortest option is selected and you open options' list it can word-break longer options
Actual behavior:
Expected behavior:
Let the dropdown by default or by specifying a prop to fit its longest option.
The text was updated successfully, but these errors were encountered: