Auto-fix lint errors
This commit is contained in:
parent
4c5720a573
commit
ae0a8b8da4
625 changed files with 3170 additions and 3232 deletions
|
@ -26,8 +26,8 @@ import React, {
|
|||
Dispatch,
|
||||
} from "react";
|
||||
|
||||
import {Key} from "../Keyboard";
|
||||
import {FocusHandler, Ref} from "./roving/types";
|
||||
import { Key } from "../Keyboard";
|
||||
import { FocusHandler, Ref } from "./roving/types";
|
||||
|
||||
/**
|
||||
* Module to simplify implementing the Roving TabIndex accessibility technique
|
||||
|
@ -156,13 +156,13 @@ interface IProps {
|
|||
onKeyDown?(ev: React.KeyboardEvent, state: IState);
|
||||
}
|
||||
|
||||
export const RovingTabIndexProvider: React.FC<IProps> = ({children, handleHomeEnd, onKeyDown}) => {
|
||||
export const RovingTabIndexProvider: React.FC<IProps> = ({ children, handleHomeEnd, onKeyDown }) => {
|
||||
const [state, dispatch] = useReducer<Reducer<IState, IAction>>(reducer, {
|
||||
activeRef: null,
|
||||
refs: [],
|
||||
});
|
||||
|
||||
const context = useMemo<IContext>(() => ({state, dispatch}), [state]);
|
||||
const context = useMemo<IContext>(() => ({ state, dispatch }), [state]);
|
||||
|
||||
const onKeyDownHandler = useCallback((ev) => {
|
||||
let handled = false;
|
||||
|
@ -196,7 +196,7 @@ export const RovingTabIndexProvider: React.FC<IProps> = ({children, handleHomeEn
|
|||
}, [context.state, onKeyDown, handleHomeEnd]);
|
||||
|
||||
return <RovingTabIndexContext.Provider value={context}>
|
||||
{ children({onKeyDownHandler}) }
|
||||
{ children({ onKeyDownHandler }) }
|
||||
</RovingTabIndexContext.Provider>;
|
||||
};
|
||||
|
||||
|
@ -218,13 +218,13 @@ export const useRovingTabIndex = (inputRef?: Ref): [FocusHandler, boolean, Ref]
|
|||
useLayoutEffect(() => {
|
||||
context.dispatch({
|
||||
type: Type.Register,
|
||||
payload: {ref},
|
||||
payload: { ref },
|
||||
});
|
||||
// teardown
|
||||
return () => {
|
||||
context.dispatch({
|
||||
type: Type.Unregister,
|
||||
payload: {ref},
|
||||
payload: { ref },
|
||||
});
|
||||
};
|
||||
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
@ -232,7 +232,7 @@ export const useRovingTabIndex = (inputRef?: Ref): [FocusHandler, boolean, Ref]
|
|||
const onFocus = useCallback(() => {
|
||||
context.dispatch({
|
||||
type: Type.SetFocus,
|
||||
payload: {ref},
|
||||
payload: { ref },
|
||||
});
|
||||
}, [ref, context]);
|
||||
|
||||
|
@ -241,6 +241,6 @@ export const useRovingTabIndex = (inputRef?: Ref): [FocusHandler, boolean, Ref]
|
|||
};
|
||||
|
||||
// re-export the semantic helper components for simplicity
|
||||
export {RovingTabIndexWrapper} from "./roving/RovingTabIndexWrapper";
|
||||
export {RovingAccessibleButton} from "./roving/RovingAccessibleButton";
|
||||
export {RovingAccessibleTooltipButton} from "./roving/RovingAccessibleTooltipButton";
|
||||
export { RovingTabIndexWrapper } from "./roving/RovingTabIndexWrapper";
|
||||
export { RovingAccessibleButton } from "./roving/RovingAccessibleButton";
|
||||
export { RovingAccessibleTooltipButton } from "./roving/RovingAccessibleTooltipButton";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue