microsoft / microsoft/fluentui

[Feature]: Popover to contain a showDelay prop like Tooltip currently has

Open
#31,017 3 comments 0 reactions 1 assignee View on GitHub

@ling1726 is already working on this.

Since May 13, 2024.

Component: Dialog Fluent UI react-components (v9) Resolution: Soft Close Type: Feature
Dominant language
TypeScript
Stars
20.3k
Forks
2.9k
Avg merge
2d 9h
Merged PRs (30d)
46

Description

Library

React Northstar / v0 (@fluentui/react-northstar)
v9 (@fluentui/react-components)

Describe the feature that you would like added

Currently there is not a showDelay prop only a mouseLeaveDelay prop.

It would be useful if this prop was present, the current solution I have which works is to control the onMouseEnter and onMouseLeave on the element inside of the trigger and set a timeout on some state for the show prop:

It would be ideal to have the ability to do something like the following on the Popover component:
<Popover showDelay={1000} onHover={true}>

Have you discussed this feature with our team

@bsunderhus advised to raise - I incorrectly raised as issue

Additional context

the current solution I have which works OK is to control the onMouseEnter and onMouseLeave on the element inside of the trigger and set a timeout on some state for the show prop:

    const timeoutID = useRef<any | undefined>(undefined);
    const [open, setOpen] = useState(false);

<Popover open={open} withArrow={true} positioning={TaskPosition}>
            <PopoverTrigger>
                  <div
                         onMouseEnter={() => (timeoutID.current = setTimeout(() => setOpen(true), 1000))}
                         onMouseLeave={() => {
                              clearTimeout(timeoutID.current);
                              setOpen(false);
                          }}>                   
                         ...
                 </div>
              </PopoverTrigger>
              <PopoverSurface>
                     <HoverCard} />
              </PopoverSurface>
</Popover>
Validations
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Priority

Low

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.