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..
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.
Most helpful comment
Solved it. Set
alignin format.formats = [ 'header', 'bold', 'italic', 'underline', 'strike', 'blockquote', 'list', 'bullet', 'indent', 'link', 'image', 'align' ]