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

Position is wrong when presented on iPad with Form Sheet presentation style #5

Closed
DrBeak1 opened this issue Oct 28, 2016 · 5 comments
Closed

Comments

@DrBeak1
Copy link

DrBeak1 commented Oct 28, 2016

Reproduce:
(1) Launch new view controller as form sheet.
(2) Tap drop down.

Expected:

  • dropdown drops down at x,y (or just below) 'please select'.

Actual:

  • drop down drops down at x,y of screen.
@sohobloo
Copy link
Owner

sohobloo commented Oct 31, 2016

@DrBeak1
It would be nice if you could provide a simplest demo which can reproduce this issue.
Thanks a lot for your feedback!

@DrBeak1
Copy link
Author

DrBeak1 commented Oct 31, 2016

sorry, don't have time to build a demo for you, but i can do next best thing. see below class and screenshot. This is all done as basic and simple as you can imagine. note that react is integrated into my obj-c project using steps here.

'use strict';

import React, { Component } from 'react'; 
import { 
    StyleSheet, 
    View,
    Text
} from 'react-native';

import ModalDropdown from 'react-native-modal-dropdown';

var NumberOfColumnsWide = 10;

class UserDemographicsView extends React.Component {
    constructor(props) {
        super(props);

        this.state = {};
        this.setState = this.setState.bind(this);
    }
    render() {
        return (
            <View style={styles.container} >
                <ModalDropdown options={['option 1', 'option 2']}/>
            </View>
        );
    }
}

const styles = StyleSheet.create({ 
    container: { 
        flex: NumberOfColumnsWide, 
        backgroundColor: '#ff0000',
        flexDirection: 'row',
    }
});

module.exports = UserDemographicsView;

img_0022

When 'please select ...' is tapped the drop down appears in upper-left hand corner.

@sohobloo
Copy link
Owner

sohobloo commented Nov 1, 2016

@DrBeak1
I'm clear now the position of the drop down is related to the 'window' rather than the sheet.
But I'm not sure I can fix it immediately since I can't find a way to judge what container to relate to when I need to calculate the position. And even I know it, I don't know how to calculate the position neither.

@sohobloo sohobloo added this to the v0.4.0 milestone Nov 18, 2016
@sohobloo
Copy link
Owner

@DrBeak1
I have an idea to workaround this issue:
Let user to re-calculate the position of the dropdown to cover my given values in mixed dropdownStyle

@sohobloo
Copy link
Owner

sohobloo commented Dec 1, 2016

There is a workaround solution since v0.4.0.

@sohobloo sohobloo closed this as completed Dec 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants