react-native-ui-lib icon indicating copy to clipboard operation
react-native-ui-lib copied to clipboard

Weird space between KeyboardTrackingView and View

Open theobouwman opened this issue 2 years ago • 3 comments

I am using the KeyboardTrackingView to attach the TextField to the keyboard. When I select the TextField it gets attached to the keyboard but it also adds an extra space between it as show in this image (the space between the keyboard and the white textfield:

Simulator Screenshot - iPhone 14 - 2023-09-08 at 16 11 53

const OrganisationGroupScreen = ({ route }: any) => {
    const params: OrganisationGroupScreenRouteProps = route.params

    const [isOrganisationAdminOrSuperAdmin] = useUserOrganisationPermission(params.organisationId, ORGANISATION_PERMISSIONS.ADMIN)

    const { data: organisationResult, isLoading } = useGetOrganizationQuery(params.organisationId)
    const organisation = organisationResult?.data

    const {data: groupResult, isLoading: isLoadingGroup } = useGetOrganisationGroupQuery({
        organisationId: params.organisationId,
        groupId: params.groupId
    })
    const group = groupResult?.data

    const canPost = isOrganisationAdminOrSuperAdmin === true ?? group?.members_can_post ?? false
    const canComment = isOrganisationAdminOrSuperAdmin === true ?? group?.members_can_comment ?? false

    if (isLoading || !organisation || isLoadingGroup || !group) {
        return (
            <View flex>
                <Card margin-10>
                    <SkeletonView
                        template={SkeletonView.templates.TEXT_CONTENT}
                        showContent={false}
                        times={2}
                    />
                </Card>
            </View>
        )
    }

    return (
        <View
            flex
        >   
            <View flex>
               <FlatList
                    ListHeaderComponent={
                        <View>
                            <View style={{
                                backgroundColor: organisation?.accent_color,
                            }} height={170} center>
                                <Card background-white>
                                    <Text text70BO>{group.name}</Text>
                                </Card>
                            </View>
                            <Card background-white borderRadius={0}>
                                <Text text80R numberOfLines={2} ellipsizeMode="tail">{group.description}</Text>
                            </Card>
                        </View>
                    }
                    data={[]}
                    renderItem={() => null}
                />
            </View>
            {canPost ?
                <KeyboardTrackingView
                    style={{
                        backgroundColor: 'white',
                    }}
                    trackInteractive
                    useSafeArea
                >
                    <View background-white marginT-10 padding-10>
                        <TextField
                            placeholder={'Ask a question'}
                            onChangeText={() => {}}
                            enableErrors
                            showCharCounter
                            multiline
                            textAlignVertical={'top'}
                            maxLength={250}
                        />
                    </View>
                </KeyboardTrackingView>
            : null}
        </View>
    )
}

theobouwman avatar Sep 08 '23 14:09 theobouwman

trying not use in react-navigation tab navigation

GregNing avatar Mar 14 '24 03:03 GregNing

@GregNing why not ifI may ask? Any other suggestions?

theobouwman avatar Mar 14 '24 11:03 theobouwman

@GregNing why not ifI may ask? Any other suggestions?

FYI

maybe have some conflict with React Navigation? still figure out

GregNing avatar Mar 18 '24 02:03 GregNing

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 31 '25 23:01 stale[bot]