From b62267b3f19f0a6851da7ff969bec95bbb6baf21 Mon Sep 17 00:00:00 2001 From: Raphael Amadeu <30945011+RaphaelAmadeu@users.noreply.github.com> Date: Wed, 3 Feb 2021 18:43:56 -0300 Subject: [PATCH] fix(card): added focus on click (#5083) ### Related Ticket(s) #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. --- packages/web-components/src/component-mixins/cta/video.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/web-components/src/component-mixins/cta/video.ts b/packages/web-components/src/component-mixins/cta/video.ts index 2c9a04e3015..ff61dd1d21a 100644 --- a/packages/web-components/src/component-mixins/cta/video.ts +++ b/packages/web-components/src/component-mixins/cta/video.ts @@ -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. @@ -41,6 +41,7 @@ const VideoCTAMixin = >(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