I cant for the life of me figure out how to get the dropdown to be right aligned. I have tried playing with flex-end and absolute positioning with right: 0 etc.
I am looking to have the menu options listed on the right, below and tight right to the main trigger yellow box. Or at the very least butted up to the right of the pink box. I can change the height position easy enough with marginTop
.
const TermPlanSelector = ({ options, selected, onChangeCallback }) => (
<Menu style={{ borderColor: 'yellow', borderWidth: 1 }}>
<MenuTrigger style={[formStyles.optionsSelectContainer]}>
<Text style={[formStyles.optionsSelectorText, { borderColor: 'pink', borderWidth: 1 }]}>
{ getLabel(selected, options) }
</Text>
<SelectorDownIcon />
</MenuTrigger>
<MenuOptions customStyles={{
optionsWrapper: {
borderColor: 'yellow', borderWidth: 1
},
optionsContainer: [
formStyles.optionsContainer,
{ borderColor: 'red', borderWidth: 1 }
],
}}
>
{
options.map((option) => (
<View key={option.value} style={[formStyles.optionItemView, { borderColor: 'green', borderWidth: 1 }]}>
<MenuOption onSelect={() => onChangeCallback(option.value)}>
<Text style={formStyles.optionItemText}>
{option.label}
</Text>
</MenuOption>
</View>
))
}
</MenuOptions>
</Menu>
);