react-native-select-pro icon indicating copy to clipboard operation
react-native-select-pro copied to clipboard

[BUG?] Android option list dropdown placement

Open julian-dueck opened this issue 1 year ago • 2 comments

Describe the bug Is this the default behavior on Android for the option list? I can't see what I'm typing (it's searchable). What can I do to make it appear right under the select field, just like in iOS?

To Reproduce Default Select component.

Expected behavior Dropdown appears under the select field.

Screenshots select-android

Environment:

  • OS: Android
  • OS Version: Android API 34
  • React Native Version 0.74.5, expo 51.0.39
  • Device on which issue is presented: Simulator Google Pixel 8

julian-dueck avatar Dec 20 '24 20:12 julian-dueck

Did you end up finding a solution for this? For me, it was occurring because I was using react-native-safe-area-context to position my modal. So, the following did the trick:

import { useSafeAreaInsets } from 'react-native-safe-area-context';

const insets = useSafeAreaInsets();

<Select 
    options={data}
    styles={{ optionsList: { marginTop: insets.top } }} />

hsb-tonmoy avatar Jan 03 '25 04:01 hsb-tonmoy

Hi @julian-dueck ,

Thank you for reporting this issue!

I tested the behavior of the Select component on Android using the following minimal example:

import * as React from 'react';
import { SafeAreaView, View } from 'react-native';
import { Select, SelectProvider } from '@mobile-reality/react-native-select-pro';

export const DATA = [
    { value: '1', label: 'First label' },
    { value: '2', label: 'Second label' },
    { value: '3', label: 'Third label' },
];

export const App = () => {
    return (
        <SafeAreaView style={{ flex: 1 }}>
            <SelectProvider>
                <View style={{ marginTop: 100 }}>
                    <Select options={DATA} searchable={true} />
                </View>
            </SelectProvider>
        </SafeAreaView>
    );
};

In this example, the dropdown appears correctly under the select field, and the input is visible while typing.

Could you:

Check if the issue persists with the above example? Share your code or a simplified example where the issue occurs? This will help me debug and understand your scenario better.

dawidgierdal avatar Jan 23 '25 10:01 dawidgierdal