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

[Popup] If a fragment anchor is located inside a popup, should it open upon navigation? #315

Closed
mfreed7 opened this issue Apr 7, 2021 · 4 comments
Labels
popover The Popover API

Comments

@mfreed7
Copy link
Collaborator

mfreed7 commented Apr 7, 2021

For example, here:

<popup id=foo>
   <div id=bar>Hello</div>
</popup>

Should navigating to the #foo or #bar fragments automatically open the popup?

With that behavior, some of the use cases listed in #311 could be declaratively achieved, without needing an open attribute.

Some corner cases that might be interesting:

<popup id=p></popup>
<button popup=p id=anchor></button>

==> should navigating to #anchor open the popup?

<popup>
  <popup>
    <span id=anchor></span>
  </popup>
</popup>

==> should only the innermost popup be shown? The issue here is that it won't be visible - it is nested inside another non-shown <popup>, which is display:none.

I think the popup stack behavior is pretty clear in this case: navigating to a fragment anchor like this should behave as if .show() was called on the relevant popup. So if there's already another popup showing when the navigation happens, the existing popup is closed.

@flackr @mirisuzanne @stubbornella

@mirisuzanne
Copy link
Contributor

This use-case came up in a conversation about popups, and I think that's useful. I can imagine linking to a specific menu-item, for example. But I think the pattern becomes even more useful when applied to more persistent elements like a dialog or details.

@mfreed7
Copy link
Collaborator Author

mfreed7 commented Apr 8, 2021

Another similar issue, which might deserve its own issue, was brought up at today's OpenUI meeting: should Find in Page be able to discover the content of a hidden <popup>? And should Find in Page be able to show the popup when that entry is selected by Find in Page?

Similar issues are being tackled for <summary>/<details>, via content visibility, so perhaps there's some overlap here. @josepharhar @chrishtr @tantek

@hidde
Copy link
Contributor

hidde commented Apr 15, 2021

I agree with @mirisuzanne and think it is useful for popups, dialog and details/summary.

An example in the wild: on the WAI Website we have a script that checks if the URL has a fragment identifier and opens the relevant details element, as we found people would want to see that opened if they link to it (example: fragment link where anchor is inside details). Would be nice is this was platform behavior.

@melanierichards melanierichards added the agenda+ Use this label if you'd like the topic to be added to the meeting agenda label Apr 28, 2021
@gregwhitworth gregwhitworth removed the agenda+ Use this label if you'd like the topic to be added to the meeting agenda label May 5, 2021
@mfreed7
Copy link
Collaborator Author

mfreed7 commented Oct 15, 2021

I think this issue is fully covered/subsumed by #344. I'm going to close this one.

@mfreed7 mfreed7 closed this as completed Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
popover The Popover API
Projects
None yet
Development

No branches or pull requests

5 participants