-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
List View: Fix error when switching between template preview modes #58533
Merged
andrewserong
merged 1 commit into
trunk
from
fix/list-view-when-switching-between-template-preview-mode
Feb 1, 2024
Merged
List View: Fix error when switching between template preview modes #58533
andrewserong
merged 1 commit into
trunk
from
fix/list-view-when-switching-between-template-preview-mode
Feb 1, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOL I just pushed this: Difference is, you know what you're doing. I can remove the bit in my PR that addresses the issue as I'm trying to fix another bug as well. |
Size Change: +4 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
ramonjd
added a commit
that referenced
this pull request
Feb 1, 2024
ramonjd
approved these changes
Feb 1, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for the quick work!
ramonjd
added a commit
that referenced
this pull request
Feb 4, 2024
ramonjd
added a commit
that referenced
this pull request
Feb 5, 2024
* This commit: - checks for a clientId in the list view to fix a bug in template editing mode where no block is selected - turns the logo button into a back button similar to the document bar when editing a template to avoid creating a post_type=wp_template link (which doesn't work) * Rolling back change in favour of #58533 * Updating tests and adding some to cover the new functionality * This commit adds a method to the post editor settings that return the initial post id and post type. * No need for a useCallback. Use useMemo! * Reverting adding intialPost props to the settings. Prop drill down to the relevant component.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Feature] List View
Menu item in the top toolbar to select blocks from a list of links.
[Type] Bug
An existing feature does not function as intended
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Fix an editor error that gets thrown if the list view is open when pressing the Back button after going to edit a post's template
Why?
It seems that during the remount / switch between template preview modes, it's possible for
getBlock( clientId )
to be called on an existing list view row and return nothing. This results in components further down the chain failing as they all expect a block to really exist.How?
null
for the list view leaf if there is no block availablereturn null
(pleases the linter)useListViewScrollIntoView
to be before thereturn null
(so that we're not conditionally calling that hook)Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Before
2024-02-01.14.00.09.mp4
After
2024-02-01.14.40.45.mp4