Skip to content

Conversation

@dominik-petrik
Copy link
Contributor

What: Closes #7072

}
};

const onMouseEnter = (event: any) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I need some help with typing the event parameter, I tried couple things but could not come up with what type and type conversions to use. It'd be great if anyone could help.

@patternfly-build
Copy link
Contributor

patternfly-build commented Jun 19, 2023

Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

This is looking good so far! Had some comments below, additionally some other comments below for @andrew-ronaldson

  • if we're offering a Popover to be triggered on hover, we should also support it being triggered on focus for users that navigate with keyboard. Otherwise they won't be able to view the Popover content (assuming this is a choice between hover or click).
  • Is it expected that a hover Popover won't contain any content that requires/offers interaction? I.e. buttons/links, scrollable containers that require scrolling, etc. If there is interactive content within this type of Popover, it could lead to a11y issues. Tying into the above bullet, if I focus a trigger and that causes a Popover to open, focus would have to be placed inside the Popover when I press Tab if there's interactive content; that might require (us or consumers) to manage focus if a Popover is appended to the end of the document.

const showTimerRef = React.useRef(null);
const hideTimerRef = React.useRef(null);
const popoverRef = React.useRef(null);
const hideShowTime = variant === 'hover' ? animationDuration : 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

This will probably have to be updated once #9339 goes in, cc @wise-king-sullyman

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah it will if it's needed, though I'm not sure it will be? In #9339 I already have the entryDelay and exitDelay props enabling consumer side customization of those timeout values.

@dominik-petrik dominik-petrik force-pushed the popover-hover-variant branch from 6d413f0 to 8a0d617 Compare July 18, 2023 13:12
Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

Depending on the order things are merged, may need another update if 9339 goes in first

@thatblindgeye thatblindgeye force-pushed the popover-hover-variant branch from 8a0d617 to 2d48c15 Compare August 2, 2023 12:27
@thatblindgeye
Copy link
Contributor

Opened #9441 to resolve the tests that were skipped in this PR

@tlabaj tlabaj requested a review from mmenestr August 2, 2023 14:47
Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

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

lgtm

@mmenestr
Copy link
Collaborator

mmenestr commented Aug 3, 2023

Looks good! Just wonder about how short the delay is between hover and popover showing up - as long as that delay time is customizable, I approve!

@tlabaj tlabaj merged commit 5d1c92e into patternfly:main Aug 3, 2023
nicolethoen pushed a commit to Kells512/patternfly-react that referenced this pull request Sep 1, 2023
* feat(Popover) add option to trigger popover on hover

* trigger popover on focus, minor changes

* Removed unnecessary hideShowTime var

* Skipped failing tests

---------

Co-authored-by: Eric Olkowski <thatblindgeye@gmail.com>
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.

Popover: add option to trigger a popover on hover

6 participants