question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't click Fab with Badge positioned over top right corner

See original GitHub issue

Hi! Thanks for trying out NativeBase! Due to the overwhelming requests and issues/questions we ask you to add the following details with your issue.

Please check the existing open/closed issues for a possible duplicate before creating a new issue 😃

Also DO fill out the below form to give us a better idea about your environment and help us debug it quicker. Issues without the required details will mostly be unattended to.

react-native, react and native-base version

latest for each

Expected behaviour

fab is clickable, with badge in top right corner

Actual behaviour

fab is not clickable

Steps to reproduce (code snippet or screenshot)

<View pointerEvents={'none'} style={{position:'absolute',elevation:20,bottom:58,right:18}}>
    <Badge danger>
        <Text>1</Text>
    </Badge>
</View>
<Fab 
    style={{backgroundColor:'#00BCD4'}}
    position="bottomRight"
    active={false}
    onPress={()=>{alert('hi')}}
>
    <Icon name="md-chatboxes" />
</Fab>

Screenshot of emulator/device

Is the bug present in both ios and android or in any one of them?

Any other additional info which would help us debug the issue quicker.

i was able to position the badge over the fab, but the fab becomes unclickable. i can’t find any info about this on google, plz help.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
SupriyaKalghatgicommented, May 25, 2018

@r3wt

i made the modifications as shown in your code and it still doesn’t work!

If you tried @akhil-geekyants 's snippet, then thats not possible to fail You probably mixed up your prototype with this

1reaction
akhil-gacommented, May 24, 2018

@r3wt checked this. It is working fine for me. Attaching a gif.

Tested code

import React, { Component } from 'react';
import { Container, Header, View, Button, Icon, Fab, Badge, Text } from 'native-base';
export default class App extends Component {
  constructor() {
    super();
    this.state = {
      active: 'true'
    };
  }
  render() {
    return (
      <Container>
        <Header />
        <View style={{ flex: 1 }}>
          <View pointerEvents={'none'} style={{ position: 'absolute', elevation: 40, bottom: 58, right: 18, zIndex: 1 }}>
            <Badge danger>
              <Text>1</Text>
            </Badge>
          </View>
          <Fab
            style={{ backgroundColor: '#00BCD4' }}
            position="bottomRight"
            active={false}
            onPress={() => { alert('hi') }}
          >
            <Icon name="md-chatboxes" />
          </Fab>
        </View>
      </Container>
    );
  }
}

Gif

fab

Read more comments on GitHub >

github_iconTop Results From Across the Web

Floating action button with badge counter | by Michael Spitsin
But in our project it is only needed to be on top right corner, so I ignored that setting. So we want to...
Read more >
v-btn (floating action button) positioned absolute top does not ...
Check your CSS - your card is having overflow: hidden . Remove this CSS rule and it will work as expected. new Vue({...
Read more >
Buttons: floating action button - Material Design
A floating action button (FAB) performs the primary, or most common, action on a screen. It appears in front of all screen content,...
Read more >
Badge | Angular Material
Badges are small status descriptors for UI elements. A badge consists of a small circle, typically containing a number or other short set...
Read more >
ion-popover - Ionic Framework
ion-popover is a dialog that appears on top of the current page. ... should be presented when the trigger is left clicked, right...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found