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

[Core/Datetime] remove usePortal={false} where not documented #2539

Merged
merged 2 commits into from
Jun 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/core/src/components/menu/menuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ export class MenuItem extends React.PureComponent<IMenuItemProps & React.AnchorH
interactionKind={PopoverInteractionKind.HOVER}
modifiers={SUBMENU_POPOVER_MODIFIERS}
position={Position.RIGHT_TOP}
usePortal={false}
{...popoverProps}
content={<Menu>{children}</Menu>}
minimal={true}
Expand Down
1 change: 0 additions & 1 deletion packages/datetime/src/dateInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ export class DateInput extends AbstractPureComponent<IDateInputProps, IDateInput
return (
<Popover
isOpen={this.state.isOpen && !this.props.disabled}
usePortal={false}
{...popoverProps}
autoFocus={false}
className={classNames(popoverProps.className, this.props.className)}
Expand Down
1 change: 0 additions & 1 deletion packages/datetime/src/dateRangeInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ export class DateRangeInput extends AbstractPureComponent<IDateRangeInputProps,
<Popover
isOpen={this.state.isOpen}
position={Position.BOTTOM_LEFT}
usePortal={false}
{...this.props.popoverProps}
autoFocus={false}
className={popoverClassName}
Expand Down
7 changes: 6 additions & 1 deletion packages/datetime/test/dateInputTests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import { Classes, DateInput, IDateInputProps, TimePicker, TimePrecision } from "
import { DATE_FORMAT } from "./common/dateFormat";
import * as DateTestUtils from "./common/dateTestUtils";

// Change the default for testability
DateInput.defaultProps.popoverProps = { usePortal: false };

describe("<DateInput>", () => {
it("handles null inputs without crashing", () => {
assert.doesNotThrow(() => mount(<DateInput {...DATE_FORMAT} value={null} />));
Expand All @@ -29,7 +32,9 @@ describe("<DateInput>", () => {
const CLASS_1 = "foo";
const CLASS_2 = "bar";

const wrapper = mount(<DateInput {...DATE_FORMAT} className={CLASS_1} popoverProps={{ className: CLASS_2 }} />);
const wrapper = mount(
<DateInput {...DATE_FORMAT} className={CLASS_1} popoverProps={{ className: CLASS_2, usePortal: false }} />,
);
wrapper.setState({ isOpen: true });

const popoverTarget = wrapper.find(`.${CoreClasses.POPOVER_WRAPPER}`).hostNodes();
Expand Down
11 changes: 10 additions & 1 deletion packages/datetime/test/dateRangeInputTests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ type InvalidDateTestFunction = (
otherInputGetterFn: (root: WrappedComponentRoot) => WrappedComponentInput,
) => void;

// Change the default for testability
DateRangeInput.defaultProps.popoverProps = { usePortal: false };

describe("<DateRangeInput>", () => {
const START_DAY = 22;
const START_DATE = new Date(2017, Months.JANUARY, START_DAY);
Expand Down Expand Up @@ -91,7 +94,11 @@ describe("<DateRangeInput>", () => {
const CLASS_2 = "bar";

const wrapper = mount(
<DateRangeInput {...DATE_FORMAT} className={CLASS_1} popoverProps={{ className: CLASS_2 }} />,
<DateRangeInput
{...DATE_FORMAT}
className={CLASS_1}
popoverProps={{ className: CLASS_2, usePortal: false }}
/>,
);
wrapper.setState({ isOpen: true });

Expand Down Expand Up @@ -360,6 +367,7 @@ describe("<DateRangeInput>", () => {
popoverWillClose: sinon.spy(),
popoverWillOpen: sinon.spy(),
position: Position.TOP_LEFT,
usePortal: false,
};
const { root } = wrap(<DateRangeInput {...DATE_FORMAT} popoverProps={popoverProps} />);

Expand All @@ -380,6 +388,7 @@ describe("<DateRangeInput>", () => {
autoFocus: true,
content: CUSTOM_CONTENT,
enforceFocus: true,
usePortal: false,
};
const { root } = wrap(<DateRangeInput {...DATE_FORMAT} popoverProps={popoverProps} />);

Expand Down