type fixes in grafana-ui
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user