-
Notifications
You must be signed in to change notification settings - Fork 58
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
Blur post title any time a new block is added #1231
Conversation
I'm labeling this "not ready for review" while I'm looking into the e2e tests it looks like I broke. 😔 |
Hey, @mchowning I saw a similar error on |
Thanks @marecar3 ! Ironically, it was seeing that your PR passed the build that made me think I must have broken it with my PR. 😆 Looks like I'm green now that the fixes were merged though. 🎉 |
c0b9e88
to
cb8f1c6
Compare
@mchowning @marecar3 Yeah it seems when there's too many jobs queued up to be ran on the 5 available concurrent emulators if a job stays in the queue too long it'll hit the timeout waiting for the run to start, currently thinking of ways to avoid this but in scenarios like that where the test hasn't even kicked off due to a timeout, re-running the job should do the trick(granted there aren't other jobs waiting 😅 ) |
Hey @JavonDavis, thanks for elaboration on this one :) |
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.
Nice work @mchowning!
LGTM!
cb8f1c6
to
66dd13d
Compare
Related gutenberg PR
Description
Fixes #932 , which was the problem that any time the post title was selected and a new image block was added, the post title would retain focus (i.e., the cursor). In fact, this issue occurred anytime a non-text block is added from the
post-title
. In particular, addingimage
,video
,more
,seperator
, orpage break
blocks all leave focus with the post's title if it had focus immediately before the new block was added.Implementation and Alternative Approaches
This PR insures the post-title is not selected when a new block is created by updating the post title to not be selected any time there is a selected block in the redux store (the post's title itself is not considered a selected block).
An alternative approach would have been to have the
visual-editor
give theblock-list
a callback that would set thevisual-editor
'sisPostTitleSelected
prop to false. Theblock-list
could then execute that callback any time that a new block was added via itsonBlockTypeSelected
method. I did not use this approach because the redux store already knows whether a block is selected, and I wanted to avoid communicating that same information in a second way.Another approach would be to move the post title's selected state itself into the redux store. This would have the advantage of simplifying the passing of that state information. Currently, the
visual-editor
holds that state so it can pass it down to both theblock-list
andpost-title
components. In addition, we are passing a ref to thepost-title
all the way up to theEditor
component (post-title -> visual-editor -> layout -> edit-post) so that the post title can be selected from the native side. I did not go with this approach because both of the reasons we need to share/update the post-title's state are mobile specific, so this would cause the store for mobile to be different from web.Would appreciate any other opinions on how best to approach this.
Testing
Fixes #932
image
,video
,more
,separator
, orpage break
)Regression check
Update release notes
RELEASE-NOTES.txt
.