Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion packages/calcite-components/src/components/card/card.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,17 @@ describe("calcite-card", () => {
});

describe("focusable", () => {
focusable("calcite-card");
describe("default", () => {
focusable("calcite-card");
});

describe("with interactive children", () => {
focusable(html`
<calcite-card id="parent">
<div tabindex="0">focusable child</div>
</calcite-card>
`);
});
});

describe("accessible", () => {
Expand Down
13 changes: 7 additions & 6 deletions packages/calcite-components/src/components/card/card.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// @ts-strict-ignore
import { createRef } from "lit-html/directives/ref.js";
import {
LitElement,
property,
createEvent,
h,
JsxNode,
LitElement,
method,
property,
state,
JsxNode,
ToEvents,
} from "@arcgis/lumina";
import { slotChangeHasAssignedElement } from "../../utils/dom";
Expand Down Expand Up @@ -135,9 +135,10 @@ export class Card extends LitElement implements InteractiveComponent {
*/
@method()
async setFocus(options?: FocusOptions): Promise<void> {
return this.focusSetter(() => {
return this.containerEl.value;
}, options);
return this.focusSetter(
() => ({ target: this.containerEl.value, includeContainer: true }),
options,
);
}

//#endregion
Expand Down
Loading