-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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] inserter point in mobile app #20195
Conversation
It also covers below test scenarios from other PR connected with Appender/Separator:
With this one there should be no more regression in changes implemented so far. |
packages/block-editor/src/components/block-list/index.native.js
Outdated
Show resolved
Hide resolved
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 👍
@@ -116,6 +118,10 @@ export class BlockList extends Component { | |||
scrollViewStyle={ { flex: isRootList ? 1 : 0 } } | |||
data={ blockClientIds } | |||
keyExtractor={ identity } | |||
extraData={ | |||
shouldShowInsertionPointBefore || |
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.
we could define a forceRefresh
variable that has this value and use it here, it would make this change more explicit
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.
This would increase code readability
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 with the steps provided on WPiOS, this is fixing the issue
* fix inserter point in gutenberg-mobile
* Add view with accesibility label on top of floating toolbar (#20267) * [FIX] inserter point in mobile app (#20195) * fix inserter point in gutenberg-mobile * Make sure that all strong tags are removed from title. (#20291) Co-authored-by: Drapich Piotr <[email protected]> Co-authored-by: Sérgio Estêvão <[email protected]>
Description
Gutenberg-mobile PR: wordpress-mobile/gutenberg-mobile#1894
I found an issue with the inserter point in the mobile app. The inserter was rendered even if the Add block bottom sheet was hidden. Look at the screen:
It happens because we removed the
extraData
prop from FlatList. Because of that if thedata
is the same (it is the same in the case when we open bottom sheet and hide it- we don't change anything ) therenderItem
is not called and we end with the wrong state of list items (they are not re-rendered after change of props).I also fixed the inserter for the first block in an empty post. The Inserter should be rendered instead of a paragraph placeholder.
How has this been tested?
add before
oradd after
and check if inserter is in the right placeScreenshots
Types of changes
Fix for inserter
Checklist: