Skip to content
Snippets Groups Projects
Unverified Commit 5a9c2b02 authored by Olivia Simonet's avatar Olivia Simonet Committed by GitHub
Browse files

Gestion du scroll dans la recherche (#716)

parent 4ff57cf1
No related branches found
No related tags found
No related merge requests found
/* eslint-disable no-undef */
import { focusTrap } from '../utils/focus-trap';
const CLASSES = {
modalOpened: 'has-modal-opened'
};
class Search {
constructor (container) {
this.state = {
......@@ -126,6 +130,9 @@ class Search {
this.element.setAttribute('aria-hidden', !this.state.isOpened);
this.button.setAttribute('aria-expanded', this.state.isOpened);
const classAction = this.state.isOpened ? 'add' : 'remove';
document.documentElement.classList[classAction](CLASSES.modalOpened);
if (open) {
this.input = this.element.querySelector('input');
this.input.focus();
......
......@@ -34,7 +34,7 @@ header#document-header
&.is-sticky
.pagefind-ui__toggle
color: $header-sticky-color
html.is-scrolling-down:not(.has-menu-opened) &
html.is-scrolling-down:not(.has-menu-opened, .has-modal-opened) &
@include media-breakpoint-down(desktop)
transform: translateY(-100%)
@include media-breakpoint-up(desktop)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment