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

Refactor polaris-button-group component #447

Merged
merged 4 commits into from
Nov 29, 2019

Conversation

vladucu
Copy link
Member

@vladucu vladucu commented Nov 29, 2019

No description provided.

@vladucu vladucu self-assigned this Nov 29, 2019
Copy link
Member

@andrewpye andrewpye left a comment

Choose a reason for hiding this comment

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

@action
setupAutoWrapper(element) {
// TODO When we're auto-wrapping we bypass the group item component, so we will not handle
// focus events and hence not apply correct class to the wrapper group item
Copy link
Member

Choose a reason for hiding this comment

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

Is this a new issue? When does it occur/what are the symptoms?

Also thinking... can we ever handle this without some (probably hacky) workaround? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

This is an existing issue....whenever users of this component are not explicitly wrapping buttons inside buttonGroup.item components, we will auto-wrap buttons with a div (what we do here), but that obviously will not handle focus events that the buttonGroup.item component does

Can't think of something nice here, only if we could easily render the item component inline and wrap with it contents....sounds crazy
I'd say it might worth just deprecating this auto-wrapping for components like this (not sure if there are other)

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, probably removing auto-wrapping is the way to go to work around this, any other "fix" would probably have to be dirty 😬

segmented=(not persistActions)
data-test-id=(unless persistActions "shortcut-actions")
<PolarisButtonGroup
data-test-id={{unless persistActions "shortcut-actions"}}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
data-test-id={{unless persistActions "shortcut-actions"}}
data-test-id={{unless @persistActions "shortcut-actions"}}

?

Copy link
Member Author

Choose a reason for hiding this comment

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

we will get to this component too shortly....this was just to get tests passing

@vladucu vladucu merged commit c1b0ea2 into refactor/es6-classes Nov 29, 2019
@vladucu vladucu deleted the refactor/es6-polaris-button-group branch November 29, 2019 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants