572 Commits

Author SHA1 Message Date
Satyajit Sahoo
b70ba66f24 chore: prepare for 6.x alpha 2020-11-11 22:07:33 +01:00
Satyajit Sahoo
a2337648bf chore: publish
- @react-navigation/bottom-tabs@5.11.1
 - @react-navigation/compat@5.3.9
 - @react-navigation/core@5.14.3
 - @react-navigation/devtools@5.1.17
 - @react-navigation/drawer@5.11.2
 - @react-navigation/material-bottom-tabs@5.3.9
 - @react-navigation/material-top-tabs@5.3.9
 - @react-navigation/native@5.8.9
 - @react-navigation/stack@5.12.6
2020-11-10 20:41:26 +01:00
Satyajit Sahoo
da35085f1e fix: make sure inactive screen don't increase scroll area on web 2020-11-10 18:21:36 +01:00
Satyajit Sahoo
151055cf5a chore: publish
- @react-navigation/bottom-tabs@5.11.0
 - @react-navigation/compat@5.3.8
 - @react-navigation/core@5.14.2
 - @react-navigation/devtools@5.1.16
 - @react-navigation/drawer@5.11.0
 - @react-navigation/material-bottom-tabs@5.3.8
 - @react-navigation/material-top-tabs@5.3.8
 - @react-navigation/native@5.8.8
 - @react-navigation/routers@5.6.2
 - @react-navigation/stack@5.12.5
2020-11-09 20:17:39 +01:00
Satyajit Sahoo
50a161dc3d chore: publish
- @react-navigation/bottom-tabs@5.10.7
 - @react-navigation/compat@5.3.7
 - @react-navigation/core@5.14.1
 - @react-navigation/devtools@5.1.15
 - @react-navigation/drawer@5.10.7
 - @react-navigation/material-bottom-tabs@5.3.7
 - @react-navigation/material-top-tabs@5.3.7
 - @react-navigation/native@5.8.7
 - @react-navigation/routers@5.6.1
 - @react-navigation/stack@5.12.4
2020-11-08 09:06:37 +01:00
Satyajit Sahoo
8f0efc8db5 fix: don't hide child header automatically in stack 2020-11-07 14:39:23 +01:00
Satyajit Sahoo
1dad338b7a chore: publish
- @react-navigation/bottom-tabs@5.10.6
 - @react-navigation/compat@5.3.6
 - @react-navigation/core@5.14.0
 - @react-navigation/devtools@5.1.14
 - @react-navigation/drawer@5.10.6
 - @react-navigation/material-bottom-tabs@5.3.6
 - @react-navigation/material-top-tabs@5.3.6
 - @react-navigation/native@5.8.6
 - @react-navigation/routers@5.6.0
 - @react-navigation/stack@5.12.3
2020-11-04 22:37:22 +01:00
Satyajit Sahoo
ce7d20e336 fix: disable react-native-screens on iOS for older versions 2020-11-04 22:36:43 +01:00
marhaupe
1169ed0946 fix: android textinput gets blurred after navigating back
When navigating from ScreenA to ScreenB and then back to ScreenA,
react-navigation unconditionally calls `Keyboard.dismiss()`.
If the user is fast enough and taps on a `TextInput` after coming
back from ScreenB, the keyboard opens, just to be dismissed again.
This would also happen if some logic automatically focuses the
`TextInput` in ScreenA. This behaviour can be seen observed in
https://snack.expo.io/lTDZhVNhV.
2020-11-04 22:35:57 +01:00
Satyajit Sahoo
a495506e20 chore: publish
- @react-navigation/bottom-tabs@5.10.5
 - @react-navigation/compat@5.3.5
 - @react-navigation/core@5.13.5
 - @react-navigation/devtools@5.1.13
 - @react-navigation/drawer@5.10.5
 - @react-navigation/material-bottom-tabs@5.3.5
 - @react-navigation/material-top-tabs@5.3.5
 - @react-navigation/native@5.8.5
 - @react-navigation/stack@5.12.2
2020-11-04 13:24:15 +01:00
Satyajit Sahoo
84cc0d758a chore: publish
- @react-navigation/bottom-tabs@5.10.4
 - @react-navigation/compat@5.3.4
 - @react-navigation/core@5.13.4
 - @react-navigation/devtools@5.1.12
 - @react-navigation/drawer@5.10.4
 - @react-navigation/material-bottom-tabs@5.3.4
 - @react-navigation/material-top-tabs@5.3.4
 - @react-navigation/native@5.8.4
 - @react-navigation/stack@5.12.1
2020-11-03 07:04:08 +01:00
Satyajit Sahoo
bd9f0ad5f6 chore: publish
- @react-navigation/bottom-tabs@5.10.3
 - @react-navigation/compat@5.3.3
 - @react-navigation/core@5.13.3
 - @react-navigation/devtools@5.1.11
 - @react-navigation/drawer@5.10.3
 - @react-navigation/material-bottom-tabs@5.3.3
 - @react-navigation/material-top-tabs@5.3.3
 - @react-navigation/native@5.8.3
 - @react-navigation/stack@5.12.0
2020-11-03 06:31:58 +01:00
Satyajit Sahoo
c326c106f9 feat: add a headerBackAccessibilityLabel option in stack
closes #9016
2020-11-03 06:22:51 +01:00
Satyajit Sahoo
37b9454f3e chore: publish
- @react-navigation/bottom-tabs@5.10.2
 - @react-navigation/compat@5.3.2
 - @react-navigation/core@5.13.2
 - @react-navigation/devtools@5.1.10
 - @react-navigation/drawer@5.10.2
 - @react-navigation/material-bottom-tabs@5.3.2
 - @react-navigation/material-top-tabs@5.3.2
 - @react-navigation/native@5.8.2
 - @react-navigation/stack@5.11.1
2020-10-30 13:42:48 +01:00
Satyajit Sahoo
5eee804e7f chore: publish
- @react-navigation/bottom-tabs@5.10.1
 - @react-navigation/compat@5.3.1
 - @react-navigation/core@5.13.1
 - @react-navigation/devtools@5.1.9
 - @react-navigation/drawer@5.10.1
 - @react-navigation/material-bottom-tabs@5.3.1
 - @react-navigation/material-top-tabs@5.3.1
 - @react-navigation/native@5.8.1
 - @react-navigation/routers@5.5.1
 - @react-navigation/stack@5.11.0
2020-10-28 22:21:16 +01:00
Satyajit Sahoo
45dbe5c40e feat: enable react-native-screens in Stack by default on iOS 2020-10-28 22:15:37 +01:00
Satyajit Sahoo
ac11a3bded chore: publish
- @react-navigation/bottom-tabs@5.10.0
 - @react-navigation/compat@5.3.0
 - @react-navigation/core@5.13.0
 - @react-navigation/devtools@5.1.8
 - @react-navigation/drawer@5.10.0
 - @react-navigation/material-bottom-tabs@5.3.0
 - @react-navigation/material-top-tabs@5.3.0
 - @react-navigation/native@5.8.0
 - @react-navigation/routers@5.5.0
 - @react-navigation/stack@5.10.0
2020-10-25 01:38:02 +02:00
Satyajit Sahoo
95600500a4 chore: upgrade depenendecies 2020-10-25 01:28:19 +02:00
Satyajit Sahoo
f51086edea feat: update helper types to have navigator specific methods 2020-10-23 18:12:36 +02:00
Wojciech Lewicki
7196889bf1 feat: add optional screens per navigator (#8805)
Changes done here will work properly with https://github.com/software-mansion/react-native-screens/pull/624 merged and released. The documentation of `screensEnabled` and `activeLimit` props should also be added. It also enabled `Screens` in iOS stack-navigator by default.

New things:
- `detachInactiveScreens` - prop for navigators with `react-native-screens` integration that can be set by user. It controls if the `react-native-screens` are used by the navigator.
- `detachPreviousScreen` - option that tells to keep the previous screen active. It can be set by user, defaults to `true` for normal mode and `false` for the last screen for mode = “modal”.

Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
2020-10-23 17:59:26 +02:00
Satyajit Sahoo
7dc2f5832e feat: improve types for navigation state (#8980)
The commit improves the navigation state object to have more specific types.
e.g. The `routeNames` array will now have proper type instead of `string[]`
2020-10-23 17:06:31 +02:00
Satyajit Sahoo
960f0a5281 refactor: make sure height set on header container is focused header height 2020-10-23 03:32:40 +02:00
Satyajit Sahoo
da91cec941 fix: add missing check for parent header when calculating height 2020-10-23 02:37:36 +02:00
Satyajit Sahoo
38e17aae93 fix: don't set statusbar height on nested header by default 2020-10-23 02:27:50 +02:00
Satyajit Sahoo
0f60b4617f refactor: refactor HeaderSegment to function component 2020-10-23 02:17:04 +02:00
Listi
d6cac6713a fix: fix header buttons not pressable when headerTransparent=true & headerMode=float (#8804)
Motivation
--
Previously when using `headerMode="float"` with headerTransparent set to true, we cant press header buttons in Android. This PR fixes this. (resolves #8731 )
Been doing some debugging and found out that this is caused by `HeaderContainer` being set as `absolute`. Initially it didn't have width & height in Android when it's set to default, that's why we can't access the children.
So, the solution in this PR is to define the height by using headerHeight. But, since we can't access headerHeight from header, Im using local state for keeping up with the headerHeight. Or should I move the HeaderHeight provider out of StackContainer? I'm not sure, since I think it was intended to be kept inside the StackContainer

Test Plan
--
With this config, now the header button can be clicked. Tested in both platform
```typescript
  <Stack.Navigator
    headerMode="float"
    screenOptions={{
      headerTransparent: true
    }}
  >
     <Stack.Screen  
      name="Home Screen"
      component={Home}
      />
      <Stack.Screen  
      name="Details Screen"
      component={Details}
      />
  </Stack.Navigator>
```

Android:
-
![Kapture 2020-09-30 at 19 01 21](https://user-images.githubusercontent.com/24470609/94682575-5b0fe480-034f-11eb-880a-318643d4eb00.gif)

iOS:
--
<img width="300" src="https://user-images.githubusercontent.com/24470609/94682743-9a3e3580-034f-11eb-8e90-2d31748bde5c.gif" />
2020-10-23 01:52:34 +02:00
Satyajit Sahoo
8ee0dda155 fix: set needsOffscreenAlphaCompositing and update default android animation
closes #8696
2020-10-23 01:38:14 +02:00
David Pett
8585f97226 docs: fix comments for gestureResponseDistance (#8954)
gestureResponseDistance vertical and horizontal documentations were swapped
2020-10-21 13:12:54 +02:00
Satyajit Sahoo
01f86d2ac6 chore: publish
- @react-navigation/bottom-tabs@5.9.2
 - @react-navigation/compat@5.2.8
 - @react-navigation/core@5.12.5
 - @react-navigation/devtools@5.1.7
 - @react-navigation/drawer@5.9.3
 - @react-navigation/material-bottom-tabs@5.2.19
 - @react-navigation/material-top-tabs@5.2.19
 - @react-navigation/native@5.7.6
 - @react-navigation/stack@5.9.3
2020-10-07 11:39:56 +02:00
Satyajit Sahoo
16e7ac131f chore: upgrade depenendecies 2020-10-07 11:18:38 +02:00
Satyajit Sahoo
e523138321 chore: publish
- @react-navigation/bottom-tabs@5.9.1
 - @react-navigation/compat@5.2.7
 - @react-navigation/drawer@5.9.2
 - @react-navigation/material-bottom-tabs@5.2.18
 - @react-navigation/material-top-tabs@5.2.18
 - @react-navigation/native@5.7.5
 - @react-navigation/stack@5.9.2
2020-09-28 16:58:23 +02:00
Satyajit Sahoo
e18578f83f chore: publish
- @react-navigation/bottom-tabs@5.9.0
 - @react-navigation/compat@5.2.6
 - @react-navigation/core@5.12.4
 - @react-navigation/devtools@5.1.6
 - @react-navigation/drawer@5.9.1
 - @react-navigation/material-bottom-tabs@5.2.17
 - @react-navigation/material-top-tabs@5.2.17
 - @react-navigation/native@5.7.4
 - @react-navigation/routers@5.4.12
 - @react-navigation/stack@5.9.1
2020-09-23 01:44:39 +02:00
Satyajit Sahoo
2bb6603aa3 chore: upgrade depenendecies 2020-09-23 01:34:55 +02:00
Bartosz Kaszubowski
050447b9ac chore: update docs website URLs to avoid the redirect (#8819) 2020-09-10 13:34:16 +02:00
Louis-Alban KIM
2d1da7ef2f fix: add aria-level to HeaderTitle 2020-09-02 16:21:20 +02:00
Satyajit Sahoo
b029e0f660 chore: publish
- @react-navigation/bottom-tabs@5.8.0
 - @react-navigation/compat@5.2.5
 - @react-navigation/core@5.12.3
 - @react-navigation/devtools@5.1.5
 - @react-navigation/drawer@5.9.0
 - @react-navigation/material-bottom-tabs@5.2.16
 - @react-navigation/material-top-tabs@5.2.16
 - @react-navigation/native@5.7.3
 - @react-navigation/routers@5.4.11
 - @react-navigation/stack@5.9.0
2020-08-04 13:28:13 +02:00
Satyajit Sahoo
cd031f0473 chore: upgrade depenendecies 2020-08-04 12:32:11 +02:00
Brent Vatne
1cb71c6c9a chore: update example to SDK 38 and bump related dependencies (#8654) 2020-07-30 17:00:55 -07:00
Satyajit Sahoo
40e2dbaecf fix: fix TouchableItem opacity on press on iOS 2020-07-29 00:41:22 +02:00
Satyajit Sahoo
0b455afa95 refactor: use libs with limited platform support explicitly
Instead of adding stubs for specific platforms such as Web, Mac OS and Windows, the commit changes the logic to use libraries such as gesture handler and masked view only for the platforms they explictly support. This means that we don't need to manually add all new platforms that aren't supported by these libraries in order for React Navigation to run on those platforms.
2020-07-29 00:24:51 +02:00
Kai Guo
8468c46cab feat: add Windows and macOS support (#8570)
react-native-gesture-handler doesn't have Windows/macOS implementation yet, use the web version as stubs for now to enable navigation features for Windows and mac.

Close https://github.com/microsoft/react-native-windows/issues/3884
Close https://github.com/microsoft/react-native-windows/issues/4044
2020-07-28 23:51:41 +02:00
Satyajit Sahoo
1e813dfb5b chore: publish
- @react-navigation/bottom-tabs@5.7.3
 - @react-navigation/compat@5.2.4
 - @react-navigation/core@5.12.2
 - @react-navigation/devtools@5.1.4
 - @react-navigation/drawer@5.8.7
 - @react-navigation/material-bottom-tabs@5.2.15
 - @react-navigation/material-top-tabs@5.2.15
 - @react-navigation/native@5.7.2
 - @react-navigation/routers@5.4.10
 - @react-navigation/stack@5.8.0
2020-07-28 14:08:02 +02:00
Martin Treurnicht
15f9b9573e feat: emit gesture navigation events from stack view (#8524)
Allows you to subscribe to gesture navigation events, we have a custom keyboard that we want to hide and show when gesture is being used to navigate (same as native keyboard)
2020-07-28 11:26:45 +02:00
Andrei Barabas
486c3defd2 feat: allow style overrides for HeaderBackButton (#8626) 2020-07-28 11:09:23 +02:00
Satyajit Sahoo
7c2b28ae1e chore: publish
- @react-navigation/bottom-tabs@5.7.2
 - @react-navigation/compat@5.2.1
 - @react-navigation/core@5.12.1
 - @react-navigation/devtools@5.1.3
 - @react-navigation/drawer@5.8.6
 - @react-navigation/material-bottom-tabs@5.2.14
 - @react-navigation/material-top-tabs@5.2.14
 - @react-navigation/native@5.7.1
 - @react-navigation/stack@5.7.1
2020-07-19 14:55:27 +02:00
Satyajit Sahoo
513482425a chore: publish
- @react-navigation/bottom-tabs@5.7.0
 - @react-navigation/compat@5.2.0
 - @react-navigation/core@5.12.0
 - @react-navigation/devtools@5.1.2
 - @react-navigation/drawer@5.8.5
 - @react-navigation/material-bottom-tabs@5.2.13
 - @react-navigation/material-top-tabs@5.2.13
 - @react-navigation/native@5.7.0
 - @react-navigation/routers@5.4.9
 - @react-navigation/stack@5.7.0
2020-07-10 22:40:45 +02:00
Satyajit Sahoo
6925e92dc3 feat: add a beforeRemove event
A lot of times, we want to prompt before leaving a screen if we have unsaved changes. Currently, we need to handle multiple cases to prevent this:

- Disable swipe gestures
- Override the back button in header
- Override the hardware back button on Android

This PR adds a new event which is emitted before a screen gets removed, and the developer has a chance to ask the user before closing the screen.

Example:

```js
React.useEffect(
  () =>
    navigation.addListener('beforeRemove', (e) => {
      if (!hasUnsavedChanges) {
        return;
      }

      e.preventDefault();

      Alert.alert(
        'Discard changes?',
        'You have unsaved changes. Are you sure to discard them and leave the screen?',
        [
          { text: "Don't leave", style: 'cancel', onPress: () => {} },
          {
            text: 'Discard',
            style: 'destructive',
            onPress: () => navigation.dispatch(e.data.action),
          },
        ]
      );
    }),
  [navigation, hasUnsavedChanges]
);
```
2020-07-02 14:32:31 +02:00
Satyajit Sahoo
9ba2f84d18 test: add basic unit tests for all navigators 2020-06-30 16:14:52 +02:00
Satyajit Sahoo
2477db47a0 chore: publish
- @react-navigation/bottom-tabs@5.6.1
 - @react-navigation/compat@5.1.28
 - @react-navigation/core@5.11.1
 - @react-navigation/devtools@5.1.1
 - @react-navigation/drawer@5.8.4
 - @react-navigation/material-bottom-tabs@5.2.12
 - @react-navigation/material-top-tabs@5.2.12
 - @react-navigation/native@5.6.1
 - @react-navigation/stack@5.6.2
2020-06-25 17:31:40 +02:00
Satyajit Sahoo
c4d2a8a828 chore: publish
- @react-navigation/stack@5.6.1
2020-06-25 11:45:59 +02:00