-
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
Display block boundaries when cursor moves while typing #1149
Conversation
What if we start moving the mouse elsewhere (outside the block boundaries), should we stop typing too? |
@youknowriad I could see both arguments:
I'm more leaning toward the second of these two options. cc @jasmussen |
I'm leaning to the latter also. |
eae6403
to
0b069fd
Compare
Rebased to resolve conflicts and pushed 0b069fd0c0c14fa088e5164f11263c0b4ced455f which binds The |
@@ -104,6 +147,10 @@ class VisualEditorBlock extends wp.element.Component { | |||
} | |||
} | |||
|
|||
stopTyping() { |
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.
Maybe we could avoid this 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.
You mean binding this.props.onStopTying
as the event handler? It's a little concerning to me since the onStopTyping
prop may not be the same in the constructor as it is when the component later unmounts (or the event is bound), so we risk zombie event listeners. I'm actually unsure of the behavior of react-redux
's mapDispatchToProps
. Seems like it should only need to generate the props once when initializing, so it's likely not a concern in reality, just in theory.
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 👍
0b069fd
to
6d4f092
Compare
Closes #657
This pull request seeks to redisplay block boundaries if the user is currently typing within a block and then moves their cursor within said block. This is the final remaining task noted in #657.
Testing instruction: