Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portal > Fab.Group prevent any click to happen on the AppBar actions. #1762

Closed
kopax opened this issue Mar 27, 2020 · 1 comment
Closed

Portal > Fab.Group prevent any click to happen on the AppBar actions. #1762

kopax opened this issue Mar 27, 2020 · 1 comment

Comments

@kopax
Copy link

kopax commented Mar 27, 2020

Current behaviour

When using an Appbar with actions (such as back action) and the <Fab.Group /> included in <Portal />, it makes it impossible to click on any actions.

More widely, it makes it impossible to use Fab.Group in my application (or any application that use an AppBar (if not all))

Expected behaviour

I expect to be able to use the app bar action normally

Code sample

    <View style={[styles.container]} pointerEvents="none">
      <Camera style={styles.container} type={type}>
        <Portal>
          <FAB.Group
            open={Platform.OS !== 'web'}
            icon="camera"
            actions={[
              {
                icon: 'camera-switch',
                onPress: () => {
                  setType(
                    type === Camera.Constants.Type.back
                      ? Camera.Constants.Type.front
                      : Camera.Constants.Type.back,
                  );
                },
              },
            ]}
            onStateChange={() => {} /* required! */}
            onPress={() => alert('take a pic')}
          />
        </Portal>
      </Camera>
    </View>

What have you tried

I have tried to add some paddingTop: 56 in the parent view, but that just add a blank line and I still can't click on the back action

Snack reproduction

https://snack.expo.io/@kopax/fascinated-cashew

https://snack.expo.io/@kopax/anxious-pudding

Your Environment

software version
ios or android ios android and web
react-native expo sdk 36
react-native-paper 3.6.0
node v13.11.0
npm or yarn npm 6.13.7
expo sdk 36
@kopax kopax mentioned this issue Mar 27, 2020
@satya164
Copy link
Member

It doesn't work because you have provided open={true} which puts a touchable behind the group. The open prop is supposed to be toggled on opening the group by pressing the FAB, and then closed by pressing the touchable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants