Skip to content

Conversation

@allejo
Copy link
Contributor

@allejo allejo commented Jul 2, 2020

The HighlightablePlainText component was accidentally creating a new ref each time by calling createRef. We should have been using useRef, which will always return the same ref for us to use on each re-render. Since changing alignment Gutenberg causes a new instance of the component to mount, we shouldn't be creating a new reference each time.

Also added support for using block alignment.

Fixes #128

/cc @grgarside

@allejo allejo requested a review from westonruter July 2, 2020 06:14
src/index.js Outdated
Comment on lines 150 to 154
supports: {
...settings.supports,
align: true,
},

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this test code?

Suggested change
supports: {
...settings.supports,
align: true,
},

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, my bad. Removed that commit 👍

Copy link

@MX-Qulin MX-Qulin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pass~

@allejo allejo force-pushed the fix/gutenberg-alignment branch from d5f5549 to c1152ef Compare July 2, 2020 14:59
Copy link

@grgar grgar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for this fix!

Copy link
Owner

@westonruter westonruter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

@westonruter westonruter merged commit 15e3e5d into develop Jul 4, 2020
@westonruter westonruter deleted the fix/gutenberg-alignment branch July 4, 2020 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding support for align to code block breaks the editor

5 participants