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: Spacer Block: Make block work on unified toolbar and spotlight mode #9993

Merged
merged 1 commit into from Sep 18, 2018

Conversation

Projects
None yet
2 participants
@jorgefilipecosta
Member

jorgefilipecosta commented Sep 18, 2018

The blocks relied on is-selected class being present in block edit div. I just checked that when unified toolbar or spotlight modes are enabled the editor does not add this classes to the BlockEdit, this made it impossible to resize the spacer block.

This seems to be an old problem and not a recent regression as the block seems to always relied on the selector ".editor-block-list__block[data-type="core/spacer"].is-selected" which is not valid in this modes.

This PR reads the prop isSelected and in that case, adds an internal class is-selected that we can safely rely on.

How has this been tested?

I checked that if spotlight mode or unified toolbar options are enabled in master it is not possible to resize the block and in this branch, the problem got fixed.

@youknowriad

Nice little refactoring. It's not a good idea to rely on the block's wrapper classnames anyway.

@jorgefilipecosta jorgefilipecosta merged commit f874704 into master Sep 18, 2018

2 checks passed

codecov/project 48.8% remains the same compared to bee8b55
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jorgefilipecosta jorgefilipecosta deleted the fix/spacer-block-on-unified-toolbar-and-spotlight-mode branch Sep 18, 2018

@jorgefilipecosta jorgefilipecosta added this to the 4.0 milestone Sep 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment