question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Text Alignment Feature

See original GitHub issue

This has been requested several times, and also has been a source of confusion. Basically at the moment the alignment plugin works solely with atomic blocks. This isn’t clear from the docs or examples and it absolutely makes sense to implement this feature. Therefore to fix this we need to enable text alignment and make it clear in the docs that the alignment plugin also works with atomic blocks and that they’re treated differently

  • Make clear in the docs that block alignment and text alignment is separate.
  • Add Text alignment buttons to draft-js-buttons for left, right, center and justify - I expect different icons may be required. These buttons would toggle block data (something like textAlignment: string)
  • Add a blockStyleFn to the alignment plugin which will add css classes depending on the textAlignment block data prop.
  • Implement handleReturn inside the alignment plugin to carry over text-alignment of the current block to the next block.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:9
  • Comments:19 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
servonlewiscommented, May 15, 2020

dying for this.

1reaction
MattyBalaamcommented, Jun 11, 2018

I’m in the process of building an editor for a new product and apart from this one feature, draft-js-plugins handles all the requirements. Has any progress been started on this yet? If not I may see if I can get up to speed with the plugin system and give this a go myself over the next couple of weeks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Alignment, Justification, and Indentation - Lumen Learning
Alignment is how text flows in relation to the rest of the page (or column, table cell, text box, etc.). There are four...
Read more >
Text Alignment in MS Word - GeeksforGeeks
This feature is used by the user to align text or paragraphs so that it gives a good look or a kind of...
Read more >
Align or justify text - Microsoft Support
Text alignment is a paragraph formatting attribute that determines the appearance of the text in a whole paragraph. For example, in a paragraph...
Read more >
Text Alignments in Word 2010 - Tutorialspoint
In this chapter, we will discuss text alignments in Word 2010. There are four types of paragraph alignment available in Microsoft Word —...
Read more >
text-align - CSS: Cascading Style Sheets - MDN Web Docs
The text-align CSS property sets the horizontal alignment of the inline-level content inside a block element or table-cell box.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found