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

[Android] ExpandableSection - fix inner component's animation not working #2990

Merged

Conversation

M-i-k-e-l
Copy link
Contributor

@M-i-k-e-l M-i-k-e-l commented Mar 20, 2024

Description

[Android] ExpandableSection - fix inner component's animation not working
In this case TextField with floatingPlaceholder inside ExpandableSection causes the placeholder on Android to not be shown.

Credit to: https://dev.to/dimaportenko/collapsible-card-with-react-native-reanimated-495a

Example screen:

import React, {Component} from 'react';
import {ScrollView, TextInput} from 'react-native';
import {View, Text, TextField, ExpandableSection} from 'react-native-ui-lib';

export default class PlaygroundScreen extends Component {
  state = {
    isExpanded1: false,
    isExpanded2: false
  };

  getHeaderElement() {
    return (
      <View margin-10 spread row>
        <Text grey10 text60>
          ExpandableSection sectionHeader
        </Text>
      </View>
    );
  }
  render() {
    return (
      <ScrollView>
        <ExpandableSection
          expanded={this.state.isExpanded1}
          top={false}
          sectionHeader={this.getHeaderElement()}
          onPress={() => this.setState({isExpanded1: !this.state.isExpanded1})}
        >
          <TextInput placeholder="Bla"/>
        </ExpandableSection>
        <ExpandableSection
          expanded={this.state.isExpanded2}
          top={false}
          sectionHeader={this.getHeaderElement()}
          onPress={() => this.setState({isExpanded2: !this.state.isExpanded2})}
        >
          <TextField placeholder="Bla" floatingPlaceholder/>
        </ExpandableSection>
      </ScrollView>
    );
  }
}

Changelog

[Android] ExpandableSection - fix inner component's animation not working

Additional info

Ticket 3616

@M-i-k-e-l M-i-k-e-l changed the title ExpandableSection - fix inner component's animation not working [Android] ExpandableSection - fix inner component's animation not working Mar 20, 2024
@Inbal-Tish Inbal-Tish merged commit a8b0798 into master Mar 31, 2024
1 check passed
@Inbal-Tish Inbal-Tish deleted the fix/expandable-section-inner-animation-not-working branch March 31, 2024 08:52
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

Successfully merging this pull request may close these issues.

None yet

2 participants