-
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
[RNMobile] Display 'expanded' inserter when title is selected #40341
Conversation
Size Change: 0 B Total Size: 1.23 MB ℹ️ View Unchanged
|
Thanks for this fix @SiobhyB ! I will jump right in to review.
cc @iamthomasbishop for the visibility as this is a departure from the original design, but I think it makes sense as a fix to ship the basic functionality of this feature. |
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 Siobhan!
I tested:
- Creating a new post and observe if visual glitch: No glitch, expanded button remains expanded ✅
- Focus on the empty paragraph block in a new post: expended button contracts ✅
- Focus back to the title: contracted button expands ✅
- Typing some text in the title: button remains expanded ✅
- Typing some text in the empty paragraph block: button contracts ✅
- Opening and closing the Inserter while paragraph is focused and has some text: button stays contracted, no glitch ✅
- Opening and closing the Inserter while paragraph is empty and focused: button stays contracted, no glitch ✅
- Removing focus from the paragaph/title (by collapsing the virtual keyboard): button expands, no glitch ✅
- Opening and closing the Inserter while nothing is focused: button stays expanded, no glitch ✅
Let's wait for the gutenberg-mobile side PR to get fully green as well.
gutenberg-mobile:
[RNMobile] Display 'expanded' inserter when title is selected wordpress-mobile/gutenberg-mobile#4757What?
An "expanded" style was applied to the block inserter and toolbar in #39726. This new style was only visible when the block or title was de-selected in the post editor. With this PR, this is updated so that the new style does display when the title is selected.
Why?
As per the following screencast, you'll see that a flash of the new "expanded" button style was displaying when first opening a post:
newpost.mov
This was happening because there is a delay of a few seconds before the title of a new post becomes selected, which caused the jump in styling.
As this is a bit off-putting, especially for users who are just creating a post for the first time, we're preventing the flash by always displaying the "expanded" button style when the title is selected in the editor.
In the future, we may change this behaviour so that the new style only displays when first opening the post editor. We're sticking to always displaying the style when a title is selected for now as we wanted to move quickly on a fix.
How?
All references to
isTitleSelected
have been removed from the logic around displaying the new style.Testing Instructions
To verify this fix, follow these steps within the WordPress Android or iOS app:
Screenshots or screencast