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

Navigation Block Responsive modal is missing fade out animation #47078

Open
TobyOsborne opened this issue Jan 11, 2023 · 1 comment
Open

Navigation Block Responsive modal is missing fade out animation #47078

TobyOsborne opened this issue Jan 11, 2023 · 1 comment
Labels
[Block] Navigation Affects the Navigation Block [Type] Enhancement A suggestion for improvement.

Comments

@TobyOsborne
Copy link

TobyOsborne commented Jan 11, 2023

What problem does this address?

In responsive view, the navigation block has a fade-in animation, but not a fade out.

What is your proposed solution?

Can we edit the MicroModal.init settings, and the SCSS to cater to this?

MicroModal.init( {
onShow: navigationToggleModal,
onClose: navigationToggleModal,
openClass: 'is-menu-open',
} );

Becomes:

MicroModal.init({
	onShow: navigationToggleModal,
	onClose: navigationToggleModal,
	openClass: "is-menu-open",
	awaitOpenAnimation: true,
	awaitCloseAnimation: true,
	disableScroll: true,
});

And then in the SCSS instead of using the is-menu-open class, use the aria-hidden attribute to set the animations (and only the animations). Which would then allow for an opening and closing animation.

.wp-block-navigation__responsive-container[aria-hidden="false"] {
	animation: ...
}

.wp-block-navigation__responsive-container[aria-hidden="true"] {
	animation: ...
}

This will open up the possibility for theme developers to change/implement different types of responsive menus without having to dequeue the view-modal script. (In my case I'm editing it to be a slideout menu).

@kathrynwp kathrynwp added [Type] Enhancement A suggestion for improvement. [Block] Navigation Affects the Navigation Block labels Jan 11, 2023
@anon36
Copy link

anon36 commented Mar 29, 2023

I would like that, too. Is there for now a way to dequeue the view-scripts?

@carolinan carolinan changed the title Navigation Block Responsive modal Navigation Block Responsive modal is missing fade out animation Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants