Skip to content

IconButton style prop is not manageable due to container element. #4339

@pranavbabu

Description

@pranavbabu

Current behaviour

When you add style prop such as zIndex to IconButton component it's no applied because IconButton wrapped in Surface component which has static styles defined.

Expected behaviour

When adding zIndex property it applies to Surface component and works.

How to reproduce?

Create <View><IconButton style={{ zIndex: 1, position: "absolute" }} /> <View style={{ backgroundColor: 'red' , width: 10, height: 10 }} ><View></View>

Preview

How it looks when I add zIndex: 1 to IconButton style prop
Screenshot 2024-03-12 at 10 27 34
How it looks when I add View wrapper with zIndex: 1
Screenshot 2024-03-12 at 10 28 05

What have you tried so far?

In order to fix it I wrapped IconButton with extra <View style={{ zIndex: 1 }}></View>

Your Environment

software version
react-native 0.73.4
react-native-paper 5.11.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions