React-quill: Text-align options are not triggering

Created on 4 Nov 2018  路  3Comments  路  Source: zenoamaro/react-quill

I just have added this package into my react project. I also added 'text-align' options into modules prop of React-quill. But the problem is that, I can see the buttons but these are not triggering (or working) after I click on them.

Here is the Codepen link.

I have defined the variable, modules like,
modules = {toolbar: [ [{ 'header': [1, 2, 3, false] }], ['bold', 'italic', 'underline'], [{ align: '' }, { align: 'center' }, { align: 'right' }, { align: 'justify' }], [{'list': 'ordered'}, {'list': 'bullet'}, {'indent': '-1'}, {'indent': '+1'}], ['link'] ]};

and declared the prop as,
<ReactQuill value={this.state.text} theme="snow" modules={this.modules} formats={this.formats} onChange={this.handleChange}/>

Please help..

Most helpful comment

Solved it. Set align in format.

formats = [ 'header', 'bold', 'italic', 'underline', 'strike', 'blockquote', 'list', 'bullet', 'indent', 'link', 'image', 'align' ]

All 3 comments

Solved it. Set align in format.

formats = [ 'header', 'bold', 'italic', 'underline', 'strike', 'blockquote', 'list', 'bullet', 'indent', 'link', 'image', 'align' ]

Hey, that isnt working. I am having the exact problem. :-(

I tried and it is working. It depends on how you have set the formats in the code.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mtando picture mtando  路  5Comments

alexkrolick picture alexkrolick  路  4Comments

andylacko picture andylacko  路  5Comments

AlexKvazos picture AlexKvazos  路  4Comments

aliciawood picture aliciawood  路  3Comments