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

display prop causes: left 100% #20

Closed
uptownhr opened this issue Aug 17, 2015 · 1 comment
Closed

display prop causes: left 100% #20

uptownhr opened this issue Aug 17, 2015 · 1 comment

Comments

@uptownhr
Copy link

I'm rendering a sample component in the react-color repo and after toggling the display on, i do not see the color picker as left:100% is there. This puts the picker off screen. Am I not using this correctly?

'use strict';

const { React, Base } = require('./base');
const ColorPicker = require('react-color');

module.exports = class Button extends Base {

  constructor() {
    super();
    this.state = {
      displayColorPicker: false,
    };
    this.handleClick = this.handleClick.bind(this);
    this.handleClose = this.handleClose.bind(this);
  }

  handleClick() {
    this.setState({ displayColorPicker: !this.state.displayColorPicker });
  }

  handleClose() {
    this.setState({ displayColorPicker: false });
  }

  render() {

    var style = {
      height: '100%'
    };

    return (
      <div style={style}>
        <button onClick={ this.handleClick }>Pick Color</button>
        <ColorPicker display={ this.state.displayColorPicker } onClose={ this.handleClose } type="sketch" />
      </div>
    );
  }
};



@casesandberg
Copy link
Owner

@uptownhr It goes 100% to the left of a div, you have to make sure the wrapper div does not go off screen.

I am working on some better positioning for it as we speak!

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

2 participants