[EuiCard] Harden Click Event Criteria to Prevent Duplicate onClick Events#6551
Merged
breehall merged 3 commits intoelastic:mainfrom Jan 26, 2023
Merged
[EuiCard] Harden Click Event Criteria to Prevent Duplicate onClick Events#6551breehall merged 3 commits intoelastic:mainfrom
onClick Events#6551breehall merged 3 commits intoelastic:mainfrom
Conversation
…ed twice when clicking on a card title by creating a condition inside of outerOnClick to ensure the link does not contain a duplicate click event.
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_6551/ |
Contributor
Quick FYI for future PRs and QA - I'd suggest a |
cee-chen
suggested changes
Jan 25, 2023
Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com>
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_6551/ |
cee-chen
approved these changes
Jan 26, 2023
Contributor
cee-chen
left a comment
There was a problem hiding this comment.
Woohoo, thanks for jumping on this Bree! ![]()
cee-chen
added a commit
to elastic/kibana
that referenced
this pull request
Feb 9, 2023
## Summary `eui@74.0.1` ⏩ `eui@74.0.2` ___ ## [`74.0.2`](https://github.com/elastic/eui/tree/v74.0.2) **Bug fixes** - Fixed `EuiCard` to ensure `onClick` method only runs once when `title` contains a React node ([#6551](elastic/eui#6551)) - Fixed `EuiSelectable` options with incorrect `aria-posinset` indices when rendered with group labels not at the start of the array ([#6571](elastic/eui#6571)) - Fixed a bug with `EuiSearchBar` where filters with `multiSelect: false` were not able to select a new option when an option was already selected ([#6577](elastic/eui#6577)) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
cee-chen
pushed a commit
to elastic/kibana
that referenced
this pull request
Feb 9, 2023
## Summary `eui@74.0.1` ⏩ `eui@74.1.0` ___ ## [`74.1.0`](https://github.com/elastic/eui/releases/tag/v74.1.0) - Added new `EuiSkeletonText`, `EuiSkeletonTitle`, `EuiSkeletonCircle`, and `EuiSkeletonRectangle` components ([#6502](elastic/eui#6502)) - Updated `EuiSuperSelect` screen reader instructions to be more specific ([#6549](elastic/eui#6549)) - Added `error` and updated `alert` glyphs to `EuiIcon` ([#6550](elastic/eui#6550)) - All `EuiSkeleton` components now accept an `isLoading` flag and `children`, which automatically handles conditionally rendering loading skeletons vs. loaded content (`children`) ([#6562](elastic/eui#6562)) - All `EuiSkeleton` components now accept a `contentAriaLabel` prop, which more meaningfully describes the loaded content to screen readers ([#6562](elastic/eui#6562)) - Updated `EuiPopover` screen reader instructions for mobile and click behaviors ([#6567](elastic/eui#6567)) **Bug fixes** - Fixed `EuiCard` to ensure `onClick` method only runs once when `title` contains a React node ([#6551](elastic/eui#6551)) **Deprecations** - Deprecated `EuiLoadingContent` - use `EuiSkeletonText` instead ([#6557](elastic/eui#6557)) --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6545
Summary
Resolved a bug that causes the
onClickmethod to be triggered twice when clicking on a card title by creating a condition inside ofouterOnClickto ensure the link does not contain a duplicate click event. Updated tests accordinglyQA
Testing:
src-docs/src/views/card/card_beta.tsx. Update the firstEuiCardinstance (line 13) to:Dashboards), you should find that the click event has only fired once, not twice.General checklist