DatePicker component is not displaying as it should when used within a Popover component.
Issue summary
DatePicker component is not displaying as it should when used within a Popover component.
Expected behavior
I'd expect the DatePicker / Popover component to appear over subsequent elements in my form.
Actual behavior
The DatePicker and Popover is been hidden behind the next TextField element.

Steps to Reproduce the Problem
- Use the code below:
<div>
<Popover
active
activator={
<TextField
type="text"
label="Pickup date"
placeholder="Select a date ..."
prefix={<Icon source="calendar" color="black"></Icon>}
value="2017-06-10"
/>
}>
<DatePicker
month="5"
year="2017"
/>
</Popover>
<TextField
type="text"
label='Pickup time'
placeholder="Select a time ..."
prefix={<Icon source="calendar" color="black"></Icon>}
/>
</div>
- Fire up your browser, and you'll see the calendar/popover lying underneath the pickup time field.
Specifications
- Polaris version: 1.1.1
- React version: 15.4.2
- Browser: Chrome
- Device: MacBook Pro
- Operating System: Sierra
Hey @cargix1, thanks for the issue. We don't really document this anywhere, but Popover (and Tooltip) decide where to stack based on a special selector, data-polaris-layer. It looks up the DOM from the activator, finds the first node with data-polaris-layer, and sets the Popover's z-index to be that node's z-index + 1. So, I think to resolve this, the simplest thing to do would be something like this:
<div data-polaris-layer style={{position: relative, z-index: 1}}>
<Popover
active
activator={
<TextField
type="text"
label="Pickup date"
placeholder="Select a date ..."
prefix={<Icon source="calendar" color="black"></Icon>}
value="2017-06-10"
/>
}>
<DatePicker
month="5"
year="2017"
/>
</Popover>
<TextField
type="text"
label='Pickup time'
placeholder="Select a time ..."
prefix={<Icon source="calendar" color="black"></Icon>}
/>
</div>
Let me know if this does not work, and I'll also make a note for us to document this.
Hey @lemonmade, thanks for replying so quick! I've just given it a test and it appears to work great thanks!

One thing I did discover was that in the code above I was passing the month and year through like month="5" and year="2017" rather then month={5} and year={2017} as stated in the documentation. This caused the calendar to appear but not include any actual dates. So just incase anyone else uses the code above just update the DatePicker component as shown below:
<DatePicker
month={5}
year={2017}
/>
Hi !
I tried the following approach but I still have some position issue on tooltip, which seems to position against the wrong element:
In this example the tooltip is wrapping the "Order #1001" at the bottom. What is the correct way to make the tooltip work? :)