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

iOS TextInput Alignment and Padding Issues #2520

Open
AnmolManocha opened this issue Aug 28, 2024 · 1 comment
Open

iOS TextInput Alignment and Padding Issues #2520

AnmolManocha opened this issue Aug 28, 2024 · 1 comment

Comments

@AnmolManocha
Copy link

AnmolManocha commented Aug 28, 2024

Issue Description

I'm developing a chat application that works seamlessly on Android, but I'm encountering issues on iOS. Specifically, the TextInput field on iOS does not behave as expected:

  1. Top Padding Issue: The text inside the TextInput touches the top boundary, causing it to look misaligned and cramped.

  2. Keyboard Behavior: When the keyboard is opened and I start typing, even entering a single letter causes the entire inputTextToolbar to shift slightly upward. This behavior is unexpected and does not occur on Android.

  3. Text Input Squeeze: After pressing enter and moving to the third line of text, the TextInput field becomes extremely squeezed, reducing the space for text input and eliminating any padding. This leads to a poor user experience.

I've attached screenshots demonstrating the issue on both Android and iOS for reference.

First Image simulator_screenshot_7996BBEA-0248-4EC4-A862-5AD3D0731187 simulator_screenshot_323FC582-1767-43B0-B83D-2B3042605215 simulator_screenshot_21F90B44-F664-4B2C-8C79-0AD694BB7102 simulator_screenshot_8A8EFB1C-6D67-4E37-814E-65FFFA253ACF simulator_screenshot_6D3C44E4-E8C9-4432-B5FA-9B9718D9647D simulator_screenshot_DF0D5EAD-ECE4-44E4-9C45-FC0F7ADECD93

Steps to Reproduce / Code Snippets

<GiftedChat
        messages={messages}
        onSend={(messages) => onSend(messages)}
        alwaysShowSend
        renderAvatar={null}
        renderSend={(props) => (
          <Send {...props} containerStyle={{ minHeight: 60 }}>
            <MCIcon name="send-circle" color="#dd1077" size={60} />
          </Send>
        )}
        renderComposer={(props) => (
          <Composer
            {...props}
            placeholder="Message"
            textInputStyle={{ color: 'black' }}
            textInputProps={{
              marginRight: 8,
              paddingHorizontal: 32,
              backgroundColor: '#fff',
              borderRadius: 26,
              minHeight: 52,
              marginLeft: 0,
              cursorColor: '#dd1077',
              selectionColor: '#dd1077',
            }}
          />
        )}
        renderInputToolbar={(props) => (
          <InputToolbar
            {...props}
            containerStyle={{
              marginHorizontal: 8,
              borderTopWidth: 0,
              paddingVertical: 12,
              backgroundColor: 'transparent',
            }}
          />
        )}
        renderBubble={renderBubble}
        minInputToolbarHeight={80}
        isLoadingEarlier={isLoading}
        loadEarlier={!chatLast}
        maxComposerHeight={Platform.OS === 'ios' ? 108 : 132}
        onLoadEarlier={loadMoreOldMessages}
        bottomOffset={Platform.OS === 'ios' ? 108 : 0}
        keyboardShouldPersistTaps={Platform.select({ android: 'always' })}
        user={{
          _id: tokenData.username,
        }}
      />

Expected Results

Screenshot_1724845987

Additional Information

  • React Native version: 0.71.8
  • react-native-gifted-chat version: ^2.4.0
  • Platform(s) (iOS, Android, or both?): iOS
@AnmolManocha AnmolManocha changed the title With same code, design and styling, composer is handling differently on Platforms iOS TextInput Alignment and Padding Issues Aug 28, 2024
@AnmolManocha AnmolManocha changed the title iOS TextInput Alignment and Padding Issues iOS TextInput Alignment and Padding Issues Aug 28, 2024
@fukemy
Copy link

fukemy commented Aug 29, 2024

better using AnimatedKeyboard, see this patch #2493

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