Skip to content

Commit

Permalink
fix: expose returnFocus prop, fixes #11
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed Jul 16, 2019
1 parent b98ae58 commit b25b5b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/UI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {effectCar} from "./medium";
export function FocusOn(props: ReactFocusOnSideProps) {
const [lockProps, setLockProps] = React.useState<LockProps>({});

const {children, autoFocus, shards, enabled = true, scrollLock = true, focusLock = true, inert, sideCar, ...rest} = props;
const {children, autoFocus, shards, enabled = true, scrollLock = true, focusLock = true, returnFocus=true, inert, sideCar, ...rest} = props;

const SideCar: SideCarComponent<EffectProps> = sideCar;

Expand All @@ -34,7 +34,7 @@ export function FocusOn(props: ReactFocusOnSideProps) {
sideCar={sideCar}
disabled={!(lockProps && enabled && focusLock)}

returnFocus
returnFocus={returnFocus}
autoFocus={autoFocus}

shards={shards}
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export interface ReactFocusOnProps extends CommonProps {
focusLock?: boolean;

autoFocus?: boolean;
returnFocus?: boolean;

children: React.ReactNode;
}
Expand Down

0 comments on commit b25b5b5

Please sign in to comment.