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 v11 #1896

Open
3 tasks
Tracked by #1629
theetrain opened this issue Jan 17, 2024 · 5 comments
Open
3 tasks
Tracked by #1629

Popover v11 #1896

theetrain opened this issue Jan 17, 2024 · 5 comments
Assignees

Comments

@theetrain
Copy link
Collaborator

theetrain commented Jan 17, 2024

Spun off from #1629

@theetrain theetrain changed the title Popover Popover v11 Jan 17, 2024
This was referenced Jan 17, 2024
@SimpleProgrammingAU
Copy link
Contributor

If this one is blocking PasswordInput from being progressed, I may as well take this one on so that I can go back and finish PasswordInput afterwards.

Happy to give it a crack with the Popover API. Have been wanting an excuse to have a proper look at it anyway.

@brunnerh
Copy link
Contributor

I'm opposed to using the popover API, it's not even in Firefox yet (only nightly).
Also it does not open on hover, so in many places JS will be needed anyway.

@SimpleProgrammingAU
Copy link
Contributor

it's not even in Firefox yet

It's been in every other major browser since September 2023. How long is reasonable to wait for Mozilla to catch up? (genuine question)

it does not open on hover

I think we could add a hover prop that could enable open on hover to avoid the need for users to write their own Javascript whenever they want to use a Popover with hover. What do you think?

@brunnerh
Copy link
Contributor

brunnerh commented Jan 21, 2024

I would not use anything that hasn't been in all major browsers at least half a year, no matter how long it takes. One year would be even better. Also, the main issue is often Safari because its updates are bound to the OS, which is just plain horrible; the update cadence is low and on older OS versions you may not even be able to get the latest Safari at all.

Regarding hover, I don't think Popover should deal with that, it's a primitive on which Tooltip builds. So the composition of components is usually:

Button/Inputs > Tooltip > Popover

In v11 there are changes to tooltips that need to be addressed:

  • What is Tooltip in v10 becomes Toggletip which opens on click and may contain interactive content
  • Tooltip is for those smaller texts, opens on hover/focus and may not contain interactive content

Note from spec:

v11 update: The tooltip component has been refactored to use the popover component under the hood to improve accessibility. Interactive tooltips now use the toggletip component to achieve accessibility standards. For v10 implementation guidance, see the v10 tooltip.

In the React version, Tooltip provides the automatic open/close logic with optional timing properties:

  enterDelayMs = 100,
  leaveDelayMs = 300,

@theetrain
Copy link
Collaborator Author

All good points. As a side note, it would be great if we could test attributes and CSS features in Playwright with a browserslist file for compatibility.

I updated the criteria above. Ideally, most of this is achievable with CSS, but the styles provided may not already work that way. Here's a handy guide: https://inclusive-components.design/tooltips-toggletips/

aria-describedby should be all that's needed to announce the tooltip content with its corresponding action like an icon button.

SimpleProgrammingAU pushed a commit to SimpleProgrammingAU/carbon-components-svelte that referenced this issue Mar 8, 2024
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

No branches or pull requests

3 participants