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

[Bug]: Clicking action button not selecting action button when action button is inside action group. #3048

Closed
1 task done
sonirajan opened this issue Mar 21, 2023 · 2 comments
Labels
bug Something isn't working Component: Action Button Component: Action Group help wanted Extra attention is needed

Comments

@sonirajan
Copy link
Contributor

Code of conduct

  • I agree to follow this project's code of conduct.

Impacted component(s)

sp-action-group, sp-action-button

Expected behavior

Clicking any action button should select it when they are child elements of action group.

Actual behavior

I’m trying to use sp-action-group component with sp-action-button as child components. When I try to select/click one of the sp-action-button, it calls handleClick event. Here, event.target is always span instead of parent sp-action-button. And, because of that target.value is always "undefined" and returns and does nothing. Is this the bug on SWC side? I have sp-action-group v0.12.9 and sp-action-button v0.10.12 installed. Slack conversion is here.

Screenshots

No response

What browsers are you seeing the problem in?

Chrome

How can we reproduce this issue?

No response

Sample code that illustrates the problem

No response

Logs taken while reproducing problem

No response

@sonirajan sonirajan added bug Something isn't working triage An issue needing triage labels Mar 21, 2023
@Westbrook
Copy link
Contributor

Indeed. Seems like we could update

const target = event.target as ActionButton;

To something like:

const target = event.composedPath().find(el => this.buttons.includes(el));

But, performant and typescripty and supported by a test.

We'd appreciate a contribution on this!

@Westbrook
Copy link
Contributor

fixed by #3292

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Component: Action Button Component: Action Group help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants