Skip to content

Commit

Permalink
fix(card): added focus on click (carbon-design-system#5083)
Browse files Browse the repository at this point in the history
### Related Ticket(s)

carbon-design-system#4744 

### Description

Added focus on click for the card component, as Safari would faltly consider `body` as the active element when the card was clicked, this caused an accessibility bug where the focus would be trapped inside `ExpressiveModal` even after closed.
  • Loading branch information
raphaelamadeu-zz authored and IgnacioBecerra committed Feb 22, 2021
1 parent 6c13690 commit b62267b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/web-components/src/component-mixins/cta/video.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license
*
* Copyright IBM Corp. 2020
* Copyright IBM Corp. 2020, 2021
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand Down Expand Up @@ -41,6 +41,7 @@ const VideoCTAMixin = <T extends Constructor<HTMLElement>>(Base: T) => {
* @param event The event.
*/
_handleClick(event: MouseEvent) {
this.focus();
const { ctaType, disabled, href } = this;
if (ctaType === CTA_TYPE.VIDEO) {
event.preventDefault(); // Stop following the link
Expand Down

0 comments on commit b62267b

Please sign in to comment.