Skip to content

Commit

Permalink
panels - only use hidden until-found if browser supports it
Browse files Browse the repository at this point in the history
- fixes wagtail#8961
  • Loading branch information
lb- committed Aug 7, 2022
1 parent 3576e27 commit 90ef1fd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/src/includes/panels.ts
Expand Up @@ -12,10 +12,12 @@ const toggleCollapsiblePanel = (

if (expanded) {
content.removeAttribute('hidden');
} else {
} else if ('onbeforematch' in document.body) {
// Use experimental `until-found` value, so users can search inside the panels.
// Browsers without support for `until-found` will ignore the value and just `display: none` the panel.
content.setAttribute('hidden', 'until-found');
} else {
// Browsers without support for `until-found` will not have this value set
content.setAttribute('hidden', '');
}

content.dispatchEvent(
Expand Down

0 comments on commit 90ef1fd

Please sign in to comment.