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: check that the modal is set before using contains #51962

Merged
merged 41 commits into from
Jun 30, 2023
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
2efa328
Start with package.json and README
DAreRodz May 26, 2023
455396b
Add new package to docs/manifest.json
DAreRodz May 26, 2023
b48ac7c
Copy-paste runtime files from block-library
DAreRodz May 26, 2023
596e4da
Add .npmrc file
DAreRodz May 26, 2023
bbcd7fa
Add interactivity package to dependencies
DAreRodz May 26, 2023
b24a7fb
Create a custom webpack config for interactivity
DAreRodz May 26, 2023
97e0278
Expose interactivity runtime in `wp.interactivity`
DAreRodz May 26, 2023
59ba71b
Update package-lock
DAreRodz May 26, 2023
d80af2d
Add `@wordpress/interactivity` to block-library deps
DAreRodz May 26, 2023
43af7ab
Rename entry point to index
DAreRodz May 26, 2023
b19d9f5
Remove vendors chunk
DAreRodz May 26, 2023
e971cd6
Add oddly required aliases
DAreRodz May 26, 2023
02701e9
Add view prefix to interactivity.js files
DAreRodz May 26, 2023
22d7543
Use view-interactivity files when enabled
DAreRodz May 26, 2023
04bf309
Stop adding defer to Interactivity scripts
DAreRodz May 26, 2023
91e3fde
Remove webpack config for interactivity.js files
DAreRodz May 26, 2023
75159c4
Remove interactivity runtime from block-library
DAreRodz May 26, 2023
df8563b
Remove interactivity runtime from sideEffects
DAreRodz May 26, 2023
7b1953f
Undo temporary fix for Interactivity API in dependency-extraction-web…
DAreRodz May 26, 2023
8a10636
Remove script loader for Interactivity API runtime
DAreRodz May 26, 2023
ffa40e7
Remove block-librar/interactivity from build_files
DAreRodz May 26, 2023
ea033b1
Add src/index.js to Interactivity API entry file
DAreRodz May 26, 2023
d9561b8
Remove unnecessary aliases
DAreRodz May 26, 2023
bec4852
Restore data-wp-body directive
DAreRodz May 26, 2023
8cb572c
Interactivity API: add `wp_store` (#51191)
luisherranz Jun 2, 2023
1b7ed17
Rename syntax to -- and data-wp-interactive (#51241)
luisherranz Jun 6, 2023
66c4c58
Merge branch 'trunk' into interactivity
luisherranz Jun 6, 2023
e740fff
Interactivity API: initial support for SSR (#51229)
luisherranz Jun 6, 2023
2f86561
Merge branch 'trunk' into interactivity
DAreRodz Jun 15, 2023
3ac4a7b
Remove require for missing script-loader.php
DAreRodz Jun 15, 2023
db7686e
Merge branch 'trunk' into interactivity
luisherranz Jun 20, 2023
4b0b87a
Remove missing PHP file
luisherranz Jun 21, 2023
02a46bb
Rename view file and fix block.json
luisherranz Jun 21, 2023
3d1a1c4
Merge branch 'trunk' into interactivity
luisherranz Jun 21, 2023
294bf69
Add "interactivity" to supports and fix renaming
luisherranz Jun 21, 2023
1ed1e34
Merge branch 'trunk' into interactivity
luisherranz Jun 23, 2023
8758865
Code improvements for the SSR part of the Interactivity API (#51640)
DAreRodz Jun 23, 2023
c745063
Add the full Interactivity API runtime (but removing the client-side …
DAreRodz Jun 27, 2023
242a3ba
Merge branch 'trunk' into interactivity
luisherranz Jun 27, 2023
3f29f8b
Check that modal exists before using `contains`
luisherranz Jun 28, 2023
06d13da
Merge branch 'trunk' into fix/navigation-block-check-modal-exists
luisherranz Jun 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/block-library/src/navigation/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const closeMenu = ( { context, selectors }, menuClosedOn ) => {
// Check if the menu is still open or not.
if ( ! selectors.core.navigation.isMenuOpen( { context } ) ) {
if (
context.core.navigation.modal.contains(
context.core.navigation.modal?.contains(
window.document.activeElement
)
) {
Expand Down Expand Up @@ -155,7 +155,7 @@ store( {
// `window.document.activeElement` doesn't change
if (
context.core.navigation.isMenuOpen.click &&
! context.core.navigation.modal.contains(
! context.core.navigation.modal?.contains(
event.relatedTarget
) &&
event.target !== window.document.activeElement
Expand Down