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

Incorrect position and zIndex of supplied DOM element #149

Open
scottwillman opened this issue May 23, 2016 · 0 comments
Open

Incorrect position and zIndex of supplied DOM element #149

scottwillman opened this issue May 23, 2016 · 0 comments

Comments

@scottwillman
Copy link

scottwillman commented May 23, 2016

React / NPM install tether-drop / v1.4.1

I really want this to work but am finding difficulty getting it to do what's advertised. When supplying a DOM element, the content seems to be centered over the target instead of pinned to the edge (as would be expected). I also can't seem to override the z-index to put it over the rest of the page (it's going behind my bootstrap nav which is at 1000).

componentDidMount() {
    var drop;
    drop = new Drop({
        target: ReactDOM.findDOMNode(this.refs.signUpTarget),
        content: ReactDOM.findDOMNode(this.refs.signUpContainer),
        position: 'bottom center',
        openOn: 'click',
    });
}

The base target:
a
What I would expect:
b
What I get:
c

Here is the full render function:

    render() {
        const style = {
         backgroundColor: '#EEE',
         boxShadow: '0 5px 10px rgba(0, 0, 0, 0.2)',
         border: '1px solid #CCC',
         padding: 10,
         width: 300,
        };

        return(
        <span>
            <a href="#" ref="signUpTarget">sign up</a>

            <div ref="signUpContainer" style={style}>
                <form>
                    <FormGroup controlId="formControlsEmail">
                        <FormControl type="text" placeholder="Email address" />
                    </FormGroup>
                    <FormGroup controlId="formControlsPassword">
                        <FormControl type="password" placeholder="Password"/>
                    </FormGroup>
                    <FormGroup controlId="formControlsPassword2">
                        <FormControl type="password" placeholder="Re-type Password" />
                    </FormGroup>
                    <FormGroup>
                        <Radio inline name="gender">Female</Radio>
                        <Radio inline name="gender">Male</Radio>
                    </FormGroup>
                    <FormGroup controlId="formControlsSubmit">
                        <Button bsStyle="success" type="submit">Sign Up</Button>
                        <Button bsStyle="link" type="button">Cancel</Button>
                    </FormGroup>
                </form>
                <a href="#" onClick={ this.hide.bind(this)}>Cancel</a>
            </div>
        </span>
    );
}
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

1 participant