-
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
Multi select flickering in Chrome 59 #2311
Comments
I've kinda tracked down what's going on here, but need someone who knows more about how multi-select should behave to jump in and clarify some things here :) The
Then when the mouse moves, we get an UPDATE_FOCUS action, which gives us:
which is focusing just one block, then we get SELECT_BLOCK, which doesn't change anything, but then we get another two UPDATE_FOCUS, the first of which changes nothing, the second of which gives us:
and that's when the multi-select flickers to show the focus just on one block (I think?) Then we get another TOGGLE_BLOCK_HOVERED as the mouse moves, and the cycle starts again with a MULTI_SELECT. |
Calling @iseulde for her expertise here! |
My initial look at the code (which I'm not too familiar with) seems to point at this: https://github.com/WordPress/gutenberg/blob/master/editor/state.js#L392 That looks to me like it could cause problems if the multi select and toggle block hovered actions arrive in an order we're not expecting? Like, we could have set the state to have selected multiple blocks, but also be hovering blocks in a way that displays their tools etc. at the same time |
Well, as my chrome just updated to 60, and this was a difficult to reproduce bug that didn't stop things actually working anyway, I'm going to close this. |
Issue Overview
In certain circumstances in Chrome 59, it's possible to have multiple blocks selected, and a single block have focus at the same time.
Steps to Reproduce (for bugs)
You should see the word "bottom" is no longer selected, and the text cursor is at the start of the word "bottom".
At first glance, this seems to be caused by the
blockSelection
state having different start and end blocks, and a focused block at the same time. I can only reproduce this in Chrome 59.Expected Behavior
It should not be possible to have multiple blocks selected, and a focused block at the same time.
Todos
The text was updated successfully, but these errors were encountered: