Skip to content

Add container to props#14

Open
septagram wants to merge 1 commit into
voronianski:masterfrom
septagram:feature/container
Open

Add container to props#14
septagram wants to merge 1 commit into
voronianski:masterfrom
septagram:feature/container

Conversation

@septagram
Copy link
Copy Markdown

Setting container to true will render Pikaday directly instead of
managing an input field. Passing a ref to another React component or a DOM
node directly should also work as expected, but was not tested.

Setting `container` to `true` will render Pikaday directly instead of
managing an input field. Passing a ref to another React component or a DOM
node directly should also work as expected, but was not tested.
@mikhuang
Copy link
Copy Markdown

I had some issues with this commit and made fixes for the calendar hiding upon entering a date as well as passing a ref to another React component. Not sure how to add those changes to this commit but they're at https://github.com/mikhuang/react-pikaday-component/tree/feature/container


this.pikaday = new Pikaday(options);

if (container === true) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not if (container) { ?


const options = Object.assign({}, pikadayOptions, {
field: el,
container: container === true ? this.refs.pikadayContainer :
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not if (container) { ?

const options = Object.assign({}, pikadayOptions, {
field: el,
container: container === true ? this.refs.pikadayContainer :
container && container.getDOMNode ? container.getDOMNode() : container,
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not possible to get into this case because of container === true will always use this.refs.pikadayContainer...

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

Successfully merging this pull request may close these issues.

3 participants