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

closed box should be automatically open when linked #1048

Open
sorawee opened this issue Nov 28, 2023 · 4 comments
Open

closed box should be automatically open when linked #1048

sorawee opened this issue Nov 28, 2023 · 4 comments
Labels
good-first-issue Good for newcomers

Comments

@sorawee
Copy link
Contributor

sorawee commented Nov 28, 2023

Say I have:

module type B =
sig
  include A
  (** @closed *)

  val x : t
  (** This is similar to {!y} *)
end

where y is in A.

Clicking the hyperlink y should open up the collapsed box automatically.

@panglesd
Copy link
Collaborator

For the records, I tested on firefox, opera and chromium, and only firefox has this problem: the details html elements are automatically opened on opera and chromium when linking to something inside them.

This could be achieved using javascript in firefox, but I wonder if we should do it or consider it as a responsibility of the browser...

@sorawee
Copy link
Contributor Author

sorawee commented Dec 18, 2023

Thanks for testing! I should have checked other browsers too.

@panglesd
Copy link
Collaborator

Related to this issue, there is also the "in page search" feature which should ideally open boxes. It does in chromium and opera but not in firefox (https://bugzilla.mozilla.org/show_bug.cgi?id=1724299). But this is much harder to do a workaround!

Thanks for finding the link to the bugzilla on this one! I spent too long trying to find it without success...

@Julow
Copy link
Collaborator

Julow commented Jan 22, 2024

Considering that this is a browser bug is handy, as it avoid implementing a browser-specific workaround and shipping more javascript.
But I'm in favor of implementing a workaround as this might prevent users from reading documentation.

Could the following work in pure CSS ?

If a closed <details> contains a focused element, color it similarly to a focused element.
This would avoid hiding the focused element as the <details> element conceptually becomes the focused element while it's closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants