-
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
Fix navigation editor error #28190
Fix navigation editor error #28190
Conversation
…h selectionStart and selectionEnd props
Size Change: +1.64 kB (0%) Total Size: 1.28 MB
ℹ️ View Unchanged
|
matchUrlToRoute( request.url(), matchingRoutes ) && | ||
request.method() === restMethod, | ||
onRequestMatch: createJSONResponse( | ||
processor( responsesByMethod[ restMethod ] ) |
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.
While the test is mostly working, this processor
shouldn't run for every method, a POST to create a menu only returns a single item so doesn't need to be mapped.
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.
Probably best to get rid of this concept and process the data before it's passed into the mocking function.
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.
Tested and works very well.
Description
Currently when interacting with blocks on the navigation screen there's an error in the console:
entity-provider.js:175 Uncaught (in promise) TypeError: Cannot read property 'selectionStart' of undefined
This seems to have been introduced by #27954, one of the changes there is that the
onChange
function returned by theuseEntityBlockEditor
hook must be passed an object as the second argument with the selectionStart and selection End.The navigation editor wraps
onChange
and wasn't passing this new second argument, but does now after this fix.How has this been tested?
Added an e2e test
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: