drop icon indicating copy to clipboard operation
drop copied to clipboard

Incorrect position and zIndex of supplied DOM element

Open scottwillman opened this issue 10 years ago • 0 comments

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>
    );
}

scottwillman avatar May 23 '16 17:05 scottwillman