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

feat(component): add multiselect #200

Merged
merged 4 commits into from
Oct 3, 2019

Conversation

jorgemoya
Copy link
Contributor

Multi selectable component. Using the same select component but with an added multi prop that enables checkboxes on all items. Allows multiple checked elements.

Still using the same value and onItemClick props to return the selected items. In the case of being a multi select we return an array of values selected.

Screen Shot 2019-09-20 at 3 22 40 PM

@jorgemoya jorgemoya requested a review from a team September 20, 2019 20:26
@jorgemoya
Copy link
Contributor Author

There are two breaking tests I need to fix. Feel free to review while I 👀 .

packages/big-design/src/components/Checkbox/Checkbox.tsx Outdated Show resolved Hide resolved

return (
React.isValidElement(trigger) &&
React.cloneElement<React.HTMLAttributes<any> & React.RefAttributes<any>>(trigger as any, {
'aria-haspopup': true,
'aria-haspopup': 'listbox',
Copy link
Contributor

Choose a reason for hiding this comment

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

aria-haspopup can only be true/false per the spec:
https://www.w3.org/WAI/PF/aria/states_and_properties#aria-haspopup

Is there a reason why it's not? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most other libraries I saw used listbox instead of true. However, looks like VO works either way so I'll return it to spec.

box-sizing: border-box;
color: ${({ theme }) => theme.colors.secondary70};
flex: 1;
height: 26px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason for not using theme.spacing for the height still?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's no way to calculate 26px using the current values of theme.spacing. Will use remCalc.

);
}
}
export const List: React.FC<ListProps> = memo(
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice change to FC!

}

private renderChips() {
const { chips, onChipDelete } = this.props;
Copy link
Member

Choose a reason for hiding this comment

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

🍹 const { chips = [], onChipDelete } = this.props; and get rid of the if.

box-sizing: border-box;
color: ${({ theme }) => theme.colors.secondary70};
flex: 1;
height: ${remCalc(26)};
Copy link
Member

Choose a reason for hiding this comment

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

Does xLarge look pretty different? Worst case can we do a large + xxSmall?

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 can do 24 or 28, but I guess it would deviate from designs. Do you think it's worth it?

Copy link
Member

Choose a reason for hiding this comment

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

@valterfatia Thoughts on this?

@jorgemoya jorgemoya merged commit 02acf73 into bigcommerce:master Oct 3, 2019
@jorgemoya jorgemoya deleted the multi-select branch October 3, 2019 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants