Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Sep 22, 2022. It is now read-only.

Check if elements is in a closed details element #81

Open
koddsson wants to merge 2 commits into main
base: main
Choose a base branch
Loading
from check-if-elements-is-in-a-closed-details-element

Conversation

@koddsson
Copy link
Contributor

@koddsson koddsson commented Mar 8, 2022

Consider a element as hidden if it's in a closed <details> element.

Closes #77

theinterned reacted with heart emoji
@koddsson koddsson requested a review from a team as a code owner March 8, 2022 17:20
function visible(el: Target): boolean {
return (
!el.hidden &&
!el.closest('details:not([open])') &&
Copy link
Contributor Author

@koddsson koddsson Mar 8, 2022

Choose a reason for hiding this comment

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

The first summary in a details would actually be shown so we probably need something like:

Suggested change
!el.closest('details:not([open])') &&
!(elinstanceofHTMLSummaryElement&&el.closest('details:not([open])')) &&

But we need to make sure to test this.

Copy link
Contributor

@keithamus keithamus left a comment

Choose a reason for hiding this comment

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

Nice!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

2 more reviewers

@theinterned theinterned theinterned approved these changes

@keithamus keithamus keithamus approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Test for managing focus is failing

AltStyle によって変換されたページ (->オリジナル) /