Skip to content
This repository has been archived by the owner on Feb 8, 2020. It is now read-only.

Commit

Permalink
fix: dismiss keyboard on page change
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Jan 3, 2020
1 parent 8f9a250 commit 2c31d17
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/stack/src/views/Stack/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ export default class Card extends React.Component<Props> {

onTransitionStart?.({ closing: Boolean(closing) });
animation(gesture, {
isInteraction: false,
...spec.config,
velocity,
useNativeDriver: true,
toValue,
useNativeDriver: true,
isInteraction: false,
}).start(({ finished }) => {
this.handleEndInteraction();

Expand Down
6 changes: 5 additions & 1 deletion packages/stack/src/views/Stack/CardContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ export default function CardContainer({
state,
transitionSpec,
}: Props) {
React.useEffect(() => {
onPageChangeConfirm?.();
}, [active, onPageChangeConfirm]);

const handleOpen = () => {
onTransitionEnd?.({ route: scene.route }, false);
onOpenRoute({ route: scene.route });
Expand All @@ -100,7 +104,7 @@ export default function CardContainer({
};

const handleTransitionStart = ({ closing }: { closing: boolean }) => {
if (closing) {
if (active && closing) {
onPageChangeConfirm?.();
} else {
onPageChangeCancel?.();
Expand Down

0 comments on commit 2c31d17

Please sign in to comment.