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

fix(Dropdown): handle "onClick" on options #4322

Merged
merged 2 commits into from
Jan 19, 2022
Merged

Conversation

layershifter
Copy link
Member

Fixes #4315.

This PR fixes scenario when options contain an item that has onClick:

function App() {
  return (
    <Dropdown
      options={[
        { key: "foo", text: "foo", value: "foo" },
        {
          key: "bar",
          text: "bar",
          value: "bar",
          onClick: () => console.log("Hello!")
        }
      ]}
    />
  );
}

@github-actions
Copy link

size-limit report

Path Size
bundle-size/dist/Button.size.js 58.76 KB (0%)
bundle-size/dist/Icon.size.js 25.21 KB (0%)
bundle-size/dist/Image.size.js 53.91 KB (0%)
bundle-size/dist/Modal.size.js 68.9 KB (0%)
bundle-size/dist/Portal.size.js 40.61 KB (0%)

@layershifter layershifter merged commit ba0b20e into master Jan 19, 2022
@layershifter layershifter deleted the fix/dropdown-onclick branch January 19, 2022 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dropdown Item's onClick doesn't trigger Dropdown's selection
1 participant