fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Unable to control height of dropdown control

Open mdmdakbar opened this issue 9 years ago • 8 comments

Unable to control the height of dropdown control using the className prop passed. Need to depend on HtmlElement span to change the height.

Please refer the code pen link to get more details.

Products/sites affected: (if applicable) VSTS

Codepen Link - https://codepen.io/anon/pen/KyVPpa

mdmdakbar avatar Nov 02 '17 12:11 mdmdakbar

This looks like a CSS load order issue. The custom CSS you have is being loaded before the CSS for the dropdown is injected into the page, so its height setting takes lower priority:

image

Since the root classname is munged, you can't force a higher priority on the custom class name without 1.) using !important, which should be avoided if possible, or 2.) configuring the CSS to load after the component styles.

Really though, dropdown should be adapted to use @customizable so you can safely pass in a style object with overrides rather than fragile CSS-only patches. @micahgodbolt, dumb question--this isn't possible today for dropdown, is it?

Jahnp avatar Jan 23 '18 06:01 Jahnp

Everything there seems to have classnames, it's just a question of making a style specific enough, right? As for styles prop, we haven't converted dropdown over yet. It's a big array of buttons, and we're still working on getting button working how we'd like it to.

micahgodbolt avatar Jan 23 '18 15:01 micahgodbolt

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!

stale[bot] avatar Apr 11 '18 07:04 stale[bot]

@micahgodbolt This seems to be as easy as removing height from the root element and putting it on the .ms-Dropdown-title element, possibly via a prop. Any issue with me implementing that fix or should I hold off touching Dropdown?

jordandrako avatar Apr 19 '18 20:04 jordandrako

if it's just a specificity issue combine your classname with the provided classname like

.my-class-dropdown.ms-Dropdown{ height: 10px; }

this is why we try to make all selectors 1 classname only, so it's easy to override.

micahgodbolt avatar Apr 19 '18 21:04 micahgodbolt

This issue has been automatically marked as stale because it has not activity for 30 days. It will be closed if no further activity occurs within 14 days of this comment. Thank you for your contributions to Fabric React! Why am I receiving this notification?

stale[bot] avatar Jun 18 '18 22:06 stale[bot]

Dropdown is ripe for a conversion to css in js. Once that's done it'll be much easier to control various parts of the component without targeting html elements

micahgodbolt avatar Jun 18 '18 22:06 micahgodbolt

Dropdown is being converted via #5366 to css-in-js. This isn't a bug, but this conversion will make it easier to make these types of changes.

micahgodbolt avatar Jun 29 '18 19:06 micahgodbolt