Skip to content

Commit

Permalink
Revert "Add active state to Popover2 when popover is open and target …
Browse files Browse the repository at this point in the history
…is a button (#1872)"

This reverts commit adddb94.
  • Loading branch information
cmslewis committed Dec 13, 2017
1 parent 877d425 commit aea46f1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/labs/src/components/popover/popover2.tsx
Expand Up @@ -264,10 +264,9 @@ export class Popover2 extends AbstractComponent<IPopover2Props, IPopover2State>
public render() {
const { className } = this.props;
const { isOpen, disabled, hasBackdrop } = this.state;
const isHoverInteractionKind = this.isHoverInteractionKind();

let targetProps: React.HTMLAttributes<HTMLElement>;
if (isHoverInteractionKind) {
if (this.isHoverInteractionKind()) {
targetProps = {
onBlur: this.handleTargetBlur,
onFocus: this.handleTargetFocus,
Expand All @@ -289,11 +288,8 @@ export class Popover2 extends AbstractComponent<IPopover2Props, IPopover2State>
);

const children = this.understandChildren();
const targetTabIndex = this.props.openOnTargetFocus && isHoverInteractionKind ? 0 : undefined;
const targetTabIndex = this.props.openOnTargetFocus && this.isHoverInteractionKind() ? 0 : undefined;
const target: JSX.Element = React.cloneElement(children.target, {
className: classNames(children.target.props.className, {
[Classes.ACTIVE]: isOpen && !isHoverInteractionKind,
}),
// force disable single Tooltip child when popover is open (BLUEPRINT-552)
disabled: isOpen && children.target.type === Tooltip2 ? true : children.target.props.disabled,
tabIndex: targetTabIndex,
Expand Down

0 comments on commit aea46f1

Please sign in to comment.