type fixes in grafana-ui

This commit is contained in:
Ashley Harrison
2025-12-15 15:50:45 +00:00
parent 0f46f38b77
commit 481dc3e630
4 changed files with 13 additions and 4 deletions
@@ -13,7 +13,7 @@ describe('useListFocus', () => {
const testid = 'test';
const getListElement = (
ref: RefObject<HTMLUListElement>,
ref: RefObject<HTMLUListElement | null>,
handleKeys?: (event: KeyboardEvent) => void,
onClick?: () => void
) => (
@@ -1,6 +1,6 @@
import { RefObject, useRef } from 'react';
export function useFocus(): [RefObject<HTMLInputElement>, () => void] {
export function useFocus(): [RefObject<HTMLInputElement | null>, () => void] {
const ref = useRef<HTMLInputElement>(null);
const setFocus = () => {
ref.current && ref.current.focus();
@@ -13,7 +13,7 @@ describe('useMenuFocus', () => {
const testid = 'test';
const getMenuElement = (
ref: RefObject<HTMLDivElement>,
ref: RefObject<HTMLDivElement | null>,
handleKeys?: (event: KeyboardEvent) => void,
handleFocus?: () => void,
onClick?: () => void
@@ -263,7 +263,16 @@ export const Footer: StoryFn<typeof Table> = (args) => {
);
};
export const Pagination: StoryFn<typeof Table> = (args) => <Basic {...args} />;
export const Pagination: StoryFn<typeof Table> = (args) => {
const theme = useTheme2();
const data = buildData(theme, {});
return (
<DashboardStoryCanvas>
<Table {...args} data={data} />
</DashboardStoryCanvas>
);
};
Pagination.args = {
enablePagination: true,
};