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

[Popover] Popover target should only receive ACTIVE class if uncontrolled #3437

Closed
lucasray opened this issue Mar 21, 2019 · 0 comments · Fixed by #3677
Closed

[Popover] Popover target should only receive ACTIVE class if uncontrolled #3437

lucasray opened this issue Mar 21, 2019 · 0 comments · Fixed by #3677

Comments

@lucasray
Copy link
Contributor

lucasray commented Mar 21, 2019

Environment

  • Package version(s): 3.13.0
  • Browser and OS versions: All

Steps to reproduce

  1. Construct a controlled popover, whose target is a <Button>
  2. Set the popover's isOpen to true
  3. Observe that the underlying button has bp3-active applied to it

Actual behavior

Button has active class applied.

Expected behavior

Button does not have active class applied.

Possible solution

We have logic in place to apply the bp3-active class on popover targets if the popover is open and the interaction kind is not hover:

[Classes.ACTIVE]: isOpen && !isHoverInteractionKind,
. This is good for uncontrolled popovers, since the popover likely opened because the user clicked on the target button. However, this is undesirable for controlled popovers that may open without user interaction on the target button (maybe informative popovers which are nudging the user to click the target button).

This line should also check that the popover is in uncontrolled mode and only apply the active class if so.

Edit: a currently fine workaround is to set the interaction kind of the popover to PopoverInteractionKind.HOVER, but this is a semantically unmeaningful fix (interaction kind should have no effect on controlled popovers)

@adidahiya adidahiya changed the title [Popover] Popover target should only receive ACTIVE if in uncontrolled mode [Popover] Popover target should only receive ACTIVE class if uncontrolled Mar 21, 2019
@adidahiya adidahiya self-assigned this Apr 2, 2019
@adidahiya adidahiya modified the milestone: 3.17.0 Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants