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

Combobox vNext styles #22461

Merged
merged 6 commits into from
Apr 19, 2022
Merged

Combobox vNext styles #22461

merged 6 commits into from
Apr 19, 2022

Conversation

smhigley
Copy link
Contributor

Part of the Combobox convergence epic (#18133), adds styles for the combobox button & listbox/options dropdown.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 11, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 2d1c290:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@fabricteam
Copy link
Collaborator

fabricteam commented Apr 11, 2022

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-combobox
Combobox
54.566 kB
18.884 kB
60.099 kB
20.592 kB
5.533 kB
1.708 kB

🤖 This report was generated against 65926a5270c19e25bbc0931253ca1c4a90b0fb01

@size-auditor
Copy link

size-auditor bot commented Apr 11, 2022

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 65926a5270c19e25bbc0931253ca1c4a90b0fb01 (build)

@smhigley smhigley marked this pull request as ready for review April 12, 2022 16:52
@smhigley smhigley requested review from a team April 12, 2022 16:57
@andrefcdias andrefcdias removed the request for review from a team April 13, 2022 12:12
Copy link
Member

@khmakoto khmakoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with very minor comments 😄

@@ -8,6 +8,8 @@ describe('ComboButton', () => {
Component: ComboButton,
displayName: 'ComboButton',
primarySlot: 'content',
// don't test deprecated className export on new components
disabledTests: ['component-has-static-classname-exported'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TristanWatanabe We should bring up removing this test at the next v-build team meeting.

...shorthands.padding('4px'),
// bottom focus border, shared with Input, Select, and SpinButton
'::after': {
boxSizing: 'border-box',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: With absolute positioning, do you need boxSizing set?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's because of the height + border, the absolute positioning doesn't affect the internal sizing.

flexGrow: 1,
backgroundColor: 'transparent',
...shorthands.border('none'),
alignItems: 'center',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Consider also setting alignContent. My understanding is there are cases where alignContent is meaningful when the items don't take up all the available space.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alignContent affects multi-line flex alignment, which isn't allowed in the combobox trigger/faceplate. I added an explicit flexWrap: nowrap to the styles to make that clearer 👍

@@ -48,6 +50,12 @@ export const useOption_unstable = (props: OptionProps, ref: React.Ref<HTMLElemen
const selected = key ? !!selectedOptions.find(option => option.key === key) : false;
const optionValue = getValueString(value, props.children);

// check icon
let CheckIcon = <CheckmarkFilled />;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider if React.memo would be good to use here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we memoize icons elsewhere right now, so I think I'll leave as-is for now. It'd be an interesting sync question though :D

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know @tomi-msft is looking at icon rendering performance. He may have some guidance here.

@smhigley smhigley merged commit 64746a5 into microsoft:master Apr 19, 2022
marwan38 pushed a commit to marwan38/fluentui that referenced this pull request Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants